-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
40 lines (38 loc) · 966 Bytes
/
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
const path = require('path');
const webpack = require('webpack');
const proxy = process.env.DEV_SERVER_PROXY_URL || 'http://localhost:8881';
const port = process.env.DEV_SERVER_PORT || 8880;
module.exports = {
publicPath: '',
outputDir: './dist',
runtimeCompiler: true,
devServer: {
port,
proxy: {
'^/api': {
target: proxy,
changeOrigin: true,
},
},
},
chainWebpack: (config) => {
config.output.library('vApp').libraryTarget('umd');
},
configureWebpack: {
plugins: [
new webpack.ProvidePlugin({
_: 'lodash',
dayjs: 'dayjs',
$utils: [path.resolve(__dirname, 'src/utils'), 'default'], // 非工具库的自定义全局变量统一在前面加上$
$http: [path.resolve(__dirname, 'src/libs/http.js'), 'default'],
}),
],
},
css: {
loaderOptions: {
sass: {
additionalData: `@import '@/styles/variables.scss';`,
},
},
},
};