-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
56 lines (53 loc) · 1.06 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
54
55
56
const path = require('path');
const IS_PROD = ["production", "prod"].includes(process.env.NODE_ENV);
// const express = require('express');
function resolve(dir = '') {
return path.join(__dirname, './src', dir);
}
module.exports = {
baseUrl: IS_PROD ? process.env.VUE_APP_PUBLIC_PATH : "./",
productionSourceMap: !IS_PROD,
lintOnSave: false,
devServer: {
proxy: {
'/api': {
target: 'http://127.0.0.1:3000',
changeOrigin: true,
pathRewrite: {
'/api': ''
}
}
},
disableHostCheck: true
},
chainWebpack: config => {
config.plugins.delete('prefetch');
config.plugins.delete('preload');
},
configureWebpack: {
resolve: {
alias: {
core: resolve('core')
}
},
optimization: {
runtimeChunk: {
name: entrypoint => `runtime~${entrypoint.name}`
},
splitChunks: {
minChunks: 2,
minSize: 20000,
maxAsyncRequests: 20,
maxInitialRequests: 30,
name: false
}
}
},
css: {
loaderOptions: {
sass: {
data: '@import "@/assets/scss/_var.scss";@import "@/assets/scss/_mixin.scss";'
}
}
}
};