-
Notifications
You must be signed in to change notification settings - Fork 5
/
vue.config.js
53 lines (50 loc) · 1.3 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
const path = require('path');
const HtmlWebpackInjectAttributesPlugin = require('html-webpack-inject-attributes-plugin');
const isProduction = process.env.NODE_ENV === 'production';
module.exports = {
devServer: {
port: 8000,
hot: true,
disableHostCheck: true,
},
css: {
loaderOptions: {
less: {
globalVars: {
'theme-color': '#1890ff',
'font-color': '#333',
'placeholder-color': '#d8d8d8',
'foot-height': '48px',
},
},
},
},
configureWebpack: {
devtool: isProduction ? 'nosources-source-map' : 'cheap-module-eval-source-map',
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
'@assets': path.resolve(__dirname, 'src/assets'),
'@api': path.resolve(__dirname, 'src/api'),
},
},
plugins: [
new HtmlWebpackInjectAttributesPlugin({
crossorigin: 'anonymous',
}),
],
},
chainWebpack: (config) => {
config.module.rule('svg').exclude.add(path.resolve('src/assets/svg-icons')).end();
config.module
.rule('icons')
.test(/\.svg$/)
.include.add(path.resolve('src/assets/svg-icons'))
.end()
.use('svg-sprite-loader')
.loader('svg-sprite-loader')
.options({
symbolId: 'icon-[name]',
});
},
};