build: add files of vant-cli 2

This commit is contained in:
陈嘉涵
2019-11-21 14:43:22 +08:00
parent f6650aa1cd
commit 08e9d99699
46 changed files with 12125 additions and 249 deletions
@@ -0,0 +1,48 @@
import { join } from 'path';
import merge from 'webpack-merge';
import config from './webpack.base';
import HtmlWebpackPlugin from 'html-webpack-plugin';
module.exports = merge(config, {
entry: {
'site-desktop': join(__dirname, '../../site/desktop/main.js'),
'site-mobile': join(__dirname, '../../site/mobile/main.js')
},
devServer: {
open: true,
host: '0.0.0.0',
stats: 'errors-only',
disableHostCheck: true,
},
output: {
path: join(__dirname, '../../site/dist'),
publicPath: '/',
chunkFilename: 'async_[name].js'
},
optimization: {
splitChunks: {
cacheGroups: {
chunks: {
chunks: 'all',
minChunks: 2,
minSize: 0,
name: 'chunks'
}
}
}
},
plugins: [
new HtmlWebpackPlugin({
chunks: ['chunks', 'site-desktop'],
template: join(__dirname, '../../site/desktop/index.html'),
filename: 'index.html'
}),
new HtmlWebpackPlugin({
chunks: ['chunks', 'site-mobile'],
template: join(__dirname, '../../site/mobile/index.html'),
filename: 'mobile.html'
})
]
});
export default module.exports;