Skip to content

Commit 5d81ce7

Browse files
ziyounglzq4047
authored andcommitted
update webpack config (ElemeFE#17373)
1 parent d8e6fb9 commit 5d81ce7

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

build/webpack.demo.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ const isPlay = !!process.env.PLAY_ENV;
1616
const webpackConfig = {
1717
mode: process.env.NODE_ENV,
1818
entry: isProd ? {
19-
docs: './examples/entry.js',
20-
'element-ui': './src/index.js'
19+
docs: './examples/entry.js'
2120
} : (isPlay ? './examples/play.js' : './examples/entry.js'),
2221
output: {
2322
path: path.resolve(process.cwd(), './examples/element-ui/'),
@@ -148,6 +147,16 @@ if (isProd) {
148147
}),
149148
new OptimizeCSSAssetsPlugin({})
150149
);
150+
// https://webpack.js.org/configuration/optimization/#optimizationsplitchunks
151+
webpackConfig.optimization.splitChunks = {
152+
cacheGroups: {
153+
vendor: {
154+
test: /\/src\//,
155+
name: 'element-ui',
156+
chunks: 'all'
157+
}
158+
}
159+
};
151160
webpackConfig.devtool = false;
152161
}
153162

0 commit comments

Comments
 (0)