Fix webpack code splitting (#3385)

This commit is contained in:
Alexander Zinchuk 2023-06-21 18:33:40 +02:00
parent a3800e16a5
commit 860ca7d777

View File

@ -229,11 +229,19 @@ export default function createConfig(
devtool: APP_ENV === 'production' && IS_ELECTRON ? undefined : 'source-map',
...(APP_ENV !== 'production' && {
optimization: {
chunkIds: 'named',
},
}),
optimization: {
...(APP_ENV !== 'production' && { chunkIds: 'named' }),
...(['production', 'staging'].includes(APP_ENV) && {
splitChunks: {
cacheGroups: {
default: {
chunks: 'all',
minSize: 1,
},
},
},
}),
},
};
}