forked from wangyupo/vue-vuex-router
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
53 lines (47 loc) · 1.38 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
46
47
48
49
50
51
52
53
// vue.config.js
const path = require('path');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
function resolve(dir) {
return path.join(__dirname, dir)
}
module.exports = {
// 使用运行时编译器的 Vue 构建版本
runtimeCompiler: true,
// 开启生产环境SourceMap
productionSourceMap: false,
// 关闭ESLint
lintOnSave: false,
devServer: {
open: false, // 是否自动打开浏览器页面
host: '0.0.0.0', // 指定使用一个 host,默认是 localhost
port: 8080, // 端口地址
https: false, // 使用https提供服务
// 设置代理
proxy: 'http://api.zhuishushenqi.com'
},
chainWebpack: (config) => {
config.resolve.alias
.set('@', resolve('src'))
.set('assets', resolve('src/assets'))
.set('components', resolve('src/components'))
},
configureWebpack: config => {
if (process.env.NODE_ENV === 'production') {
return {
plugins: [
new BundleAnalyzerPlugin()
]
}
}
},
css: {
loaderOptions: {
sass: {
data: `
@import "@/style/mixin.scss";
@import "@/style/var.scss";
`
}
}
},
};