-
Notifications
You must be signed in to change notification settings - Fork 6
/
elux.config.js
42 lines (42 loc) · 1.19 KB
/
elux.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//工程配置文件,参见 https://eluxjs.com/guide/configure.html
// eslint-disable-next-line import/no-extraneous-dependencies
const antdVars = require('@elux-admin-antd/stage/assets/css/antd-var.json');
const {getLocalIP} = require('@elux/cli-utils');
const serverPort = 4003;
const apiHosts = {
local: `http://${getLocalIP()}:3003/`,
demo: 'http://api-admin-demo.eluxjs.com/',
};
const APP_ENV = process.env.APP_ENV || 'local';
module.exports = {
type: 'vue',
mockServer: {port: 3003},
cssProcessors: {less: {javascriptEnabled: true, modifyVars: antdVars}},
all: {
//开发和生成环境都使用的配置
serverPort,
clientGlobalVar: {
ApiPrefix: apiHosts[APP_ENV],
StaticPrefix: apiHosts[APP_ENV],
},
webpackConfigTransform: (config) => {
//此处可以自定义webpack配置
//console.log(config.module.rules[0]);
return config;
},
},
dev: {
//开发环境专用配置
eslint: false,
stylelint: false,
//要使用开发代理可以放开下面代码
// apiProxy: {
// '/api': {
// target: apiHosts[APP_ENV],
// pathRewrite: {
// '^/api': '',
// },
// },
// },
},
};