-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
45 lines (44 loc) · 1.08 KB
/
vue.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
43
44
45
const resolve = dir => require('path').join(__dirname, dir);
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
module.exports = {
publicPath: '/',
outputDir: 'dist',
assetsDir: 'static',
lintOnSave: true,
parallel: require('os').cpus().length > 1,
productionSourceMap: false,
devServer: {
open: true,
port: 8080,
https: false,
hotOnly: true,
proxy: {
'/api': {
target: 'http://localhost:8080',
// changeOrigin: true,
pathRewrite: {
'^/api': '/mock'
}
}
}
},
configureWebpack: config => {
// if (process.env.NODE_ENV === 'production') {
// // 为生产环境修改配置...
// } else {
// // 为开发环境修改配置...
// }
// config.plugins = [new BundleAnalyzerPlugin()];
config.resolve = {
extensions: ['.js', '.vue', '.json', ".css"],
alias: {
'@': resolve('src'),
'styles': resolve('src/assets/styles'),
'common': resolve('src/common'),
},
}
},
css: {
sourceMap: false
}
};