Jhernandez has uploaded a new change for review. ( 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, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/marvin refs/changes/01/380501/1 diff --git a/webpack.config.ts b/webpack.config.ts index b276ec5..49a3575 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -216,7 +216,8 @@ 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", + 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: newchange Gerrit-Change-Id: I6455715c9cddb4ff3ae221aba209588bbc57d151 Gerrit-PatchSet: 1 Gerrit-Project: marvin Gerrit-Branch: master Gerrit-Owner: Jhernandez <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
