-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvue.config.js
58 lines (56 loc) · 1.27 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
module.exports = {
publicPath: './',
outputDir: process.env.CORE_MIN === 'lib' ? 'lib' : 'docs',
filenameHashing: true,
chainWebpack(config) {
if (
process.env.NODE_ENV === 'production' &&
process.env.CORE_MIN === 'lib'
) {
config.module
.rule('fonts')
.test(/\.(woff2?|eot|ttf|otf)(\?.*)?$/i)
.use('url-loader')
.loader('url-loader')
.options({
limit: 10000,
// use explicit fallback to avoid regression in url-loader>=1.1.0
fallback: {
loader: 'file-loader',
options: {
name: 'fonts/[name].[ext]',
publicPath: './'
}
}
})
config
.plugin('extract-css')
.use(require('mini-css-extract-plugin'), [
{
filename: '[name].min.css',
chunkFilename: '[name].min.css'
}
])
}
},
configureWebpack: webpackConfig => {
if (
process.env.NODE_ENV === 'production' &&
process.env.CORE_MIN === 'lib'
) {
webpackConfig.entry = {
zov: ['./core/index.js', './core/index.scss']
}
webpackConfig.externals = {
vue: 'Vue'
}
webpackConfig.optimization.splitChunks = {}
webpackConfig.output.filename = '[name].min.js'
}
},
assetsDir: undefined,
runtimeCompiler: undefined,
productionSourceMap: undefined,
parallel: undefined,
css: undefined
}