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 webpack to make browser builds #1937

Closed
wants to merge 1 commit into from

Conversation

sophiebits
Copy link
Collaborator

Run webpack to try it. Things to fix:

  • grunt integration
  • banner should have "React with Add-Ons" or "JSXTransformer", not always "React"
  • add es3ify loader/transform
   raw     gz Compared to last run
 -4852  -4089 build/JSXTransformer.js
 +5743   -625 build/react-with-addons.js
-19304  -3636 build/react-with-addons.min.js
 +5619   -149 build/react.js
-17906  -3384 build/react.min.js

Run `webpack` to try it. Things to fix:

- [ ] grunt integration
- [ ] banner should have "React with Add-Ons" or "JSXTransformer", not always "React"

```
   raw     gz Compared to last run
     =      = build/JSXTransformer-previous.js
 -4852  -4089 build/JSXTransformer.js
     =      = build/react-previous.min.js
     =      = build/react-test.js
     =      = build/react-webpack.js
 +5743   -625 build/react-with-addons.js
-19304  -3636 build/react-with-addons.min.js
 +5619   -149 build/react.js
-17906  -3384 build/react.min.js
```
@chenglou
Copy link
Contributor

ooooh daaamn 👍

@sophiebits
Copy link
Collaborator Author

Takes ~6 seconds on my machine to build all five files when everything's cached, but you can use webpack --watch when developing React and it's basically instant.


function buildHasteMap(root) {
var hasteMap = {};
glob.sync(root + '/**/*.{js,css}').forEach(function(file) {
Copy link
Member

Choose a reason for hiding this comment

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

Probably don't need css

@zpao
Copy link
Member

zpao commented Jul 26, 2014

I'm winning for the dev builds :P

@sophiebits
Copy link
Collaborator Author

Pretty sure I can make the dev builds smaller if we care…

@zpao
Copy link
Member

zpao commented Jul 26, 2014

Cool, because browser-pack has require hardcoded in some places and I doubt there will be a PR accepted to fix that.

@sophiebits
Copy link
Collaborator Author

Oh, you lost all the license and @providesModule comments.

@syranide
Copy link
Contributor

Oooh, this is sweet.

@zpao
Copy link
Member

zpao commented Jul 28, 2015

Going to close this out. We can revisit if we need to.

@zpao zpao closed this Jul 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants