-
Notifications
You must be signed in to change notification settings - Fork 155
/
Copy pathvue.config.js
63 lines (59 loc) · 1.4 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
57
58
59
60
61
62
63
'use strict'
const path = require('path')
const CompressionPlugin = require('compression-webpack-plugin')
function resolve(dir) {
return path.join(__dirname, dir)
}
const name = 'poster'
// All configuration item explanations can be find in https://cli.vuejs.org/config/
const webpackConfig = {
publicPath: './',
outputDir: 'dist',
assetsDir: './',
lintOnSave: process.env.NODE_ENV === 'development',
productionSourceMap: false,
devServer: {
port: '8001',
open: true
// proxy: {
// '/api': {
// target: '',
// changeOrigin: true,
// pathRewrite: {
// '^/api': ''
// }
// }
// }
},
configureWebpack: {
name: name,
resolve: {
extensions: ['.ts', '.tsx', '.js', '.json'],
alias: {
'@': resolve('src'),
'poster': resolve('src/views/posterEditor')
}
},
plugins: [
new CompressionPlugin({
test: /\.js$|\.html$|\.css/,
threshold: 10240
// deleteOriginAssets:false
})
],
externals: {}
},
chainWebpack: config => {
const oneOfsMap = config.module.rule('scss').oneOfs.store
oneOfsMap.forEach(item => {
item
.use('sass-resources-loader')
.loader('sass-resources-loader')
.options({
resources: ['./src/styles/mixin.scss', './src/styles/variables.scss']
})
.end()
})
}
}
module.exports = webpackConfig