2021-12-14 18:36:19 +08:00
|
|
|
const path = require('path');
|
2024-03-20 10:41:28 +08:00
|
|
|
const proxy = process.env.VUE_APP_API || "http://192.168.1.87:9000"
|
2021-12-14 18:36:19 +08:00
|
|
|
module.exports = {
|
2024-03-21 14:49:23 +08:00
|
|
|
lintOnSave: false,
|
|
|
|
|
productionSourceMap: false,
|
|
|
|
|
css: {
|
|
|
|
|
loaderOptions: {
|
|
|
|
|
scss: {
|
|
|
|
|
data: `@import "~dui/lib/styles/vars.scss";`
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
transpileDependencies: [/dui[\\\/]lib[\\\/]js/],
|
|
|
|
|
chainWebpack: (config) => {
|
|
|
|
|
config.module
|
|
|
|
|
.rule('js')
|
|
|
|
|
.include
|
|
|
|
|
.add(path.resolve(__dirname, 'packages'))
|
|
|
|
|
.add(path.resolve(__dirname, 'components'))
|
|
|
|
|
.add(path.resolve(__dirname, 'project'))
|
|
|
|
|
.add(path.resolve(__dirname, 'examples'))
|
|
|
|
|
.add(path.resolve(__dirname, 'ui'))
|
|
|
|
|
.end().use('babel').loader('babel-loader').tap(options => options);
|
2024-03-22 11:52:39 +08:00
|
|
|
config.plugin("limit").use(require("webpack/lib/optimize/LimitChunkCountPlugin"), [{maxChunks: 20}]).tap(options => options)
|
2024-03-21 14:49:23 +08:00
|
|
|
},
|
|
|
|
|
devServer: {
|
|
|
|
|
host: '0.0.0.0', //主机地址
|
|
|
|
|
port: 7000, //端口号
|
|
|
|
|
open: true,
|
|
|
|
|
proxy: {
|
|
|
|
|
//设置代理,可解决跨
|
|
|
|
|
'/lan': {
|
|
|
|
|
target: proxy,
|
|
|
|
|
changeOrigin: true,
|
|
|
|
|
pathRewrite: {
|
|
|
|
|
//地址重写
|
|
|
|
|
'^/lan': '/'
|
2021-12-14 18:36:19 +08:00
|
|
|
}
|
2024-03-21 14:49:23 +08:00
|
|
|
},
|
2021-12-14 18:36:19 +08:00
|
|
|
},
|
2024-03-21 14:49:23 +08:00
|
|
|
disableHostCheck: true,
|
|
|
|
|
}
|
2021-12-14 18:36:19 +08:00
|
|
|
};
|