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

Reduce production .js files sizes by 51% #2617

Merged
merged 2 commits into from Aug 8, 2016

Conversation

Projects
None yet
2 participants
@bernd
Member

bernd commented Aug 4, 2016

  • Do not use the react-hot loader for production builds
  • Use "source-map" instead of "eval" for "devtool" setting in production
    builds
  • Enable source maps in the UglifyJsPlugin for production builds

By not using "eval" for the "devtool" setting we are getting much
smaller .js files. Using "source-map" for "devtool" and enabling source
maps for the UglifyJsPlugin increases the production build time, but also
produces higher quality source maps for debugging.

Before:

  • Build time: 0m39.788s
  • All .js files size: 7.9MB

After:

  • Build time: 1m4.028s
  • All .js files size: 3.8MB
Reduce production .js files sizes by 51%
- Do not use the react-hot loader for production builds
- Use "source-map" instead of "eval" for "devtool" setting in production
  builds
- Enable source maps in the UglifyJsPlugin for production builds

By not using "eval" for the "devtool" setting we are getting much
smaller .js files. Using "source-map" for "devtool" and enabling source
maps for the UglifyJsPlugin increases the production build time, but also
produces higher quality source maps for debugging.

Before:

- Build time: 0m39.788s
- All .js files size: 7.9MB

After:

- Build time: 1m4.028s
- All .js files size: 3.8MB

@bernd bernd added this to the 2.1.0 milestone Aug 4, 2016

@edmundoa edmundoa self-assigned this Aug 4, 2016

@bernd

This comment has been minimized.

Member

bernd commented Aug 4, 2016

This needs to be tested carefully that it doesn't break something.

Do not mangle certain "special" variables
Avoids issues in Rickshaw and other old libraries.
@edmundoa

This comment has been minimized.

Member

edmundoa commented Aug 8, 2016

LGTM 👍

@edmundoa edmundoa merged commit ae731ec into master Aug 8, 2016

4 checks passed

ci-server-integration Jenkins build graylog2-server-integration-pr 1223 has succeeded
Details
ci-web-linter Jenkins build graylog-pr-linter-check 706 has succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@edmundoa edmundoa deleted the webpack-improvements branch Aug 8, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment