jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/380501 )
Change subject: Perf: Avoid style-loader in dist/public/index.*.js ...................................................................... Perf: Avoid style-loader in dist/public/index.*.js Webpack was including style-loader in the bundle so that it was able to load style modules on lazy loaded code (as the fallback in ExtractTextPlugin in the loaders), which it needs when allChunks is false. We are including all CSS in the same base file, so it isn't needed, so this patch sets allChunks to true. See docs at https://github.com/webpack-contrib/extract-text-webpack-plugin options.fallback {String}/{Array}/{Object} loader(e.g 'style-loader') that should be used when the CSS is not extracted (i.e. in an additional chunk when allChunks: false) This saves 5kB from the bundle. Change-Id: I6455715c9cddb4ff3ae221aba209588bbc57d151 --- M webpack.config.ts 1 file changed, 8 insertions(+), 1 deletion(-) Approvals: Niedzielski: Looks good to me, approved jenkins-bot: Verified diff --git a/webpack.config.ts b/webpack.config.ts index b276ec5..c965af2 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -216,7 +216,14 @@ new ExtractTextPlugin({ // `contenthash` is not actually a chunk hash: // https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/504#issuecomment-306581954. - filename: PRODUCTION ? "[name].[contenthash].css" : "[name].css" + filename: PRODUCTION ? "[name].[contenthash].css" : "[name].css", + + // Extract from all additional chunks too (by default it extracts only from + // the initial chunks). When using CommonsChunkPlugin (see plugin below) and + // there are extracted chunks (from ExtractTextPlugin.extract module rule + // above) in the commons chunk, allChunks must be set to true. + // https://github.com/webpack-contrib/extract-text-webpack-plugin/blob/8de6558/README.md#options + allChunks: true }), // Create a separate chunk for client package dependencies. External -- To view, visit https://gerrit.wikimedia.org/r/380501 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6455715c9cddb4ff3ae221aba209588bbc57d151 Gerrit-PatchSet: 2 Gerrit-Project: marvin Gerrit-Branch: master Gerrit-Owner: Jhernandez <[email protected]> Gerrit-Reviewer: Niedzielski <[email protected]> Gerrit-Reviewer: Sniedzielski <[email protected]> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
