diff --git a/src/packages/excalidraw/webpack.prod.config.js b/src/packages/excalidraw/webpack.prod.config.js index 8f8c72eef..6203f066a 100644 --- a/src/packages/excalidraw/webpack.prod.config.js +++ b/src/packages/excalidraw/webpack.prod.config.js @@ -89,11 +89,19 @@ module.exports = { }), ], splitChunks: { - chunks: "async", + chunks: "all", cacheGroups: { vendors: { test: /[\\/]node_modules[\\/]/, - name: "vendor", + // cacheGroupKey here is `commons` as the key of the cacheGroup + name(module, chunks, cacheGroupKey) { + const moduleFileName = module + .identifier() + .split("/") + .reduceRight((item) => item); + const allChunksNames = chunks.map((item) => item.name).join("~"); + return `${cacheGroupKey}-${allChunksNames}-${moduleFileName}`; + }, }, }, },