-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
85 lines (85 loc) · 2.86 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
const path = require('path')
const webpack = require('webpack')
const AddAssetHtmlPlugin = require('add-asset-html-webpack-plugin')
function resolve (dir) {
return path.join(__dirname, '..', dir)
}
module.exports = {
publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
runtimeCompiler: true,
productionSourceMap: false,
filenameHashing: false,
parallel: require('os').cpus().length > 1,
chainWebpack: (config) => {
config.resolve.alias
.set('@$', resolve('src'))
.set('assets', resolve('src/assets'))
.set('components', resolve('src/components'))
.set('static', resolve('src/static'))
},
configureWebpack: {
plugins: [
new webpack.DllReferencePlugin({
context: process.cwd(),
manifest: require('./public/vendor/aceBuilds-manifest.json')
}),
new webpack.DllReferencePlugin({
context: process.cwd(),
manifest: require('./public/vendor/aceeditor-manifest.json')
}),
new webpack.DllReferencePlugin({
context: process.cwd(),
manifest: require('./public/vendor/ant-manifest.json')
}),
new webpack.DllReferencePlugin({
context: process.cwd(),
manifest: require('./public/vendor/axios-manifest.json')
}),
new webpack.DllReferencePlugin({
context: process.cwd(),
manifest: require('./public/vendor/ckvue-manifest.json')
}),
new webpack.DllReferencePlugin({
context: process.cwd(),
manifest: require('./public/vendor/codemirror-manifest.json')
}),
new webpack.DllReferencePlugin({
context: process.cwd(),
manifest: require('./public/vendor/corejs-manifest.json')
}),
new webpack.DllReferencePlugin({
context: process.cwd(),
manifest: require('./public/vendor/elementui-manifest.json')
}),
new webpack.DllReferencePlugin({
context: process.cwd(),
manifest: require('./public/vendor/jsplumb-manifest.json')
}),
new webpack.DllReferencePlugin({
context: process.cwd(),
manifest: require('./public/vendor/router-manifest.json')
}),
new webpack.DllReferencePlugin({
context: process.cwd(),
manifest: require('./public/vendor/vuedraggable-manifest.json')
}),
new webpack.DllReferencePlugin({
context: process.cwd(),
manifest: require('./public/vendor/vuex-manifest.json')
}),
new webpack.DllReferencePlugin({
context: process.cwd(),
manifest: require('./public/vendor/xregexp-manifest.json')
}),
// 将 dll 注入到 生成的 html 模板中
new AddAssetHtmlPlugin({
// dll文件位置
filepath: path.resolve(__dirname, './public/vendor/*.js'),
// dll 引用路径
publicPath: './vendor',
// dll最终输出的目录
outputPath: './vendor'
})
]
}
}