Skip to content

Commit 40a30e9

Browse files
committed
config配置预设
1 parent 63f374f commit 40a30e9

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

example/vue.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
const path = require('path');
33
// eslint-disable-next-line @typescript-eslint/no-var-requires
44
const styleJson = require('./src/styles/antd.json');
5-
// 转为es6模块 import项目运行不起来,先用require
5+
// 转为es6模块 import项目运行不起来
66

77
module.exports = {
88
publicPath: './',
@@ -26,7 +26,7 @@ module.exports = {
2626
},
2727
toTypes: {
2828
host: 'http://zx.aiisx.com/dcaw/v2/api-docs', // swagger地址
29-
TypesPath: './types/api.ts', // 生成的interface
29+
TypesPath: './src/types/api.ts', // 生成的interface
3030
},
3131
},
3232
// 解决按需引入插件css引入失败

generator/index.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ module.exports = (api, options) => {
4444
pluginOptions: {
4545
toTypes: {
4646
host: `${options.serverPath}/${options.productName}/v2/api-docs`,
47-
TypesPath: './types/api.ts',
47+
TypesPath: './src/types/api.ts',
4848
},
4949
ftp: {
5050
host: '自行配置',
@@ -54,11 +54,15 @@ module.exports = (api, options) => {
5454
},
5555
css: {
5656
loaderOptions: {
57-
less: {
58-
lessOptions: {
59-
javascriptEnabled: true,
60-
},
57+
less: {
58+
lessOptions: {
59+
modifyVars: styleJson,
60+
javascriptEnabled: true,
6161
},
62+
},
63+
stylus: {
64+
import: path.resolve(__dirname, './src/styles/variable.styl'),
65+
},
6266
},
6367
},
6468
},

0 commit comments

Comments
 (0)