Commit 3864d867 authored by hetech's avatar hetech Committed by luckyCao

update webpack config (#17373)

parent 069d96a8
...@@ -16,8 +16,7 @@ const isPlay = !!process.env.PLAY_ENV; ...@@ -16,8 +16,7 @@ const isPlay = !!process.env.PLAY_ENV;
const webpackConfig = { const webpackConfig = {
mode: process.env.NODE_ENV, mode: process.env.NODE_ENV,
entry: isProd ? { entry: isProd ? {
docs: './examples/entry.js', docs: './examples/entry.js'
'element-ui': './src/index.js'
} : (isPlay ? './examples/play.js' : './examples/entry.js'), } : (isPlay ? './examples/play.js' : './examples/entry.js'),
output: { output: {
path: path.resolve(process.cwd(), './examples/element-ui/'), path: path.resolve(process.cwd(), './examples/element-ui/'),
...@@ -148,6 +147,16 @@ if (isProd) { ...@@ -148,6 +147,16 @@ if (isProd) {
}), }),
new OptimizeCSSAssetsPlugin({}) new OptimizeCSSAssetsPlugin({})
); );
// https://webpack.js.org/configuration/optimization/#optimizationsplitchunks
webpackConfig.optimization.splitChunks = {
cacheGroups: {
vendor: {
test: /\/src\//,
name: 'element-ui',
chunks: 'all'
}
}
};
webpackConfig.devtool = false; webpackConfig.devtool = false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment