Skip to content
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

Use -p flag in webpack for minification and exclude externals react a… #159

Merged

Conversation

doque
Copy link
Contributor

@doque doque commented Apr 13, 2016

Fixes #144 .

Changes proposed:

  • Use webpack -p for minification instead of UglifyJS Plugin
  • Designate react and react-dom as externals in webpack config to exclude them from build

Reduces minified build size to 14.4kB.

@diasbruno
Copy link
Collaborator

This seems really nice. I'll test it.

@diasbruno
Copy link
Collaborator

We already know the numbers, but just to validate.

With build script and browserify:

react-modal.js     53K
react-modal.min.js 22K

With webpack:

  • reactjs/development-improvements:
             Asset    Size  Chunks             Chunk Names
    react-modal.js  719 kB    0, 1  [emitted]  react-modal
react-modal.min.js  190 kB    1, 0  [emitted]  react-modal.min
  • doque/development-improvements:
             Asset     Size  Chunks             Chunk Names
    react-modal.js    57 kB    0, 1  [emitted]  react-modal
react-modal.min.js  14.4 kB    1, 0  [emitted]  react-modal.min

This is awesome, @doque.

@diasbruno
Copy link
Collaborator

@doque It seems that without -p has the same effect as using webpack.optimize.UglifyJsPlugin, the file size i got are the same.

@claydiffrient claydiffrient merged commit 9823bc5 into reactjs:development-improvements Apr 14, 2016
@doque doque deleted the development-improvements branch April 15, 2016 07:08
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.

3 participants