forked from youzan/vant
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.site.dev.js
More file actions
47 lines (46 loc) · 1.12 KB
/
webpack.site.dev.js
File metadata and controls
47 lines (46 loc) · 1.12 KB
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
const path = require('path');
const merge = require('webpack-merge');
const config = require('./webpack.base');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = merge(config, {
entry: {
'vant-docs': './docs/site/desktop/main.js',
'vant-mobile': './docs/site/mobile/main.js'
},
devServer: {
open: true,
progress: true,
host: '0.0.0.0',
stats: 'errors-only',
disableHostCheck: true,
},
output: {
path: path.join(__dirname, '../docs/dist'),
publicPath: '/',
chunkFilename: 'async_[name].js'
},
optimization: {
splitChunks: {
cacheGroups: {
chunks: {
chunks: 'all',
minChunks: 2,
minSize: 0,
name: 'chunks'
}
}
}
},
plugins: [
new HtmlWebpackPlugin({
chunks: ['chunks', 'vant-docs'],
template: path.join(__dirname, '../docs/site/desktop/index.html'),
filename: 'index.html'
}),
new HtmlWebpackPlugin({
chunks: ['chunks', 'vant-mobile'],
template: path.join(__dirname, '../docs/site/mobile/index.html'),
filename: 'mobile.html'
})
]
});