Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/text.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2021-06-30 09:03:10 +0300
committerJulius Härtl <jus@bitgrid.net>2021-07-14 15:54:44 +0300
commitfb2d8094c1ba1ce78ca185fedaabc44fa8b3b0d7 (patch)
tree9c6ea6adda28bb7c57a0b9163c59d956bf063ffc /webpack.js
parent0b5ef3d791bb71fa3fb992e5c6f932bf639b5d68 (diff)
Fix chunk generation
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'webpack.js')
-rw-r--r--webpack.js24
1 files changed, 10 insertions, 14 deletions
diff --git a/webpack.js b/webpack.js
index c4ccd2252..0444d4018 100644
--- a/webpack.js
+++ b/webpack.js
@@ -9,21 +9,17 @@ webpackConfig.entry = {
viewer: path.join(__dirname, 'src', 'viewer.js'),
}
-webpackConfig.output.chunkFilename = '[name].js?v=[contenthash]'
-webpackConfig.optimization.splitChunks.chunks = 'all'
-Object.assign(webpackConfig.optimization.splitChunks, {
- cacheGroups: {
- highlight: {
- enforce: true,
- test: /[\\/]node_modules[\\/](hightlight\.js)[\\/]/,
+webpackConfig.output.chunkFilename = '[id].js?v=[contenthash]'
+
+webpackConfig.optimization.chunkIds = 'named'
+webpackConfig.optimization.splitChunks.cacheGroups = {
+ defaultVendors: {
+ test(module) {
+ return module.resource && module.resource.includes(`${path.sep}node_modules${path.sep}`) &&
+ !module.resource.includes(`${path.sep}highlight.js${path.sep}`)
},
- vendors: {
- test: /[\\/]node_modules[\\/]/,
- reuseExistingChunk: true
- }
+ name: 'vendors',
}
-})
-
-console.log(webpackConfig)
+}
module.exports = webpackConfig