Skip to content

Commit

Permalink
update webpack config (ElemeFE#17373)
Browse files Browse the repository at this point in the history
  • Loading branch information
ziyoung authored and hzsrc committed Feb 2, 2023
1 parent 876da5d commit a588772
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions build/webpack.demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ const isPlay = !!process.env.PLAY_ENV;
const webpackConfig = {
mode: process.env.NODE_ENV,
entry: isProd ? {
docs: './examples/entry.js',
'element-ui': './src/index.js'
docs: './examples/entry.js'
} : (isPlay ? './examples/play.js' : './examples/entry.js'),
output: {
path: path.resolve(process.cwd(), './examples/element-ui/'),
Expand Down Expand Up @@ -148,6 +147,16 @@ if (isProd) {
}),
new OptimizeCSSAssetsPlugin({})
);
// https://webpack.js.org/configuration/optimization/#optimizationsplitchunks
webpackConfig.optimization.splitChunks = {
cacheGroups: {
vendor: {
test: /\/src\//,
name: 'element-ui',
chunks: 'all'
}
}
};
webpackConfig.devtool = false;
}

Expand Down

0 comments on commit a588772

Please sign in to comment.