Skip to content

Add bundle analyzer #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

maxime-rainville
Copy link
Contributor

@maxime-rainville maxime-rainville commented Nov 3, 2019

Add a bundle analyzer to our webpack-config. That way you can define the following flag when building your bundle: ANALYZE_BUNDLE=1 yarn build

This will allow you to visualise what's in the bundle.
image

Parent issue

@maxime-rainville maxime-rainville marked this pull request as ready for review November 3, 2019 23:40
@@ -28,5 +29,6 @@ module.exports = (ENV) => {
}),
new webpack.NamedModulesPlugin(),
uglifyPlugin,
process.env.ANALYZE_BUNDLE && new BundleAnalyzerPlugin()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be better to make this some sort of parameter for the method rather than rely on the value being pass as an environment variable. Don't have strong preference either way.

@maxime-rainville maxime-rainville merged commit 8e84b71 into silverstripe:master Nov 4, 2019
@maxime-rainville maxime-rainville deleted the pulls/master/add-bundle-analyzer branch November 4, 2019 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants