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

ES 6 Target #7111

Closed
newtack opened this issue Jun 24, 2016 · 2 comments
Closed

ES 6 Target #7111

newtack opened this issue Jun 24, 2016 · 2 comments

Comments

@newtack
Copy link

newtack commented Jun 24, 2016

We are targeting ES 6 compliant, modern browsers (such as latest version of Chrome, Safari 10, etc.) and would like to leverage this to reduce the size of React build (using the latest version of React).
Is this already something that is possible, if so how? Are there other options to reduce the size of React (such as setting node environment variable to production)?

@keyz
Copy link
Contributor

keyz commented Jun 24, 2016

You can change the Babel plugins that we use to compile React to fit your needs (then npm run build yourself). However, as you can see we actually use ES6 features quite selectively so I'm not sure if you'll see a huge difference.

You might also be interested in #6351 (comment). Feel free to comment or reopen if there's anything unclear.

@keyz keyz closed this as completed Jun 24, 2016
@gaearon
Copy link
Collaborator

gaearon commented Jun 24, 2016

Are there other options to reduce the size of React (such as setting node environment variable to production)?

With CommonJS, if you envify process.env.NODE_ENV to be "production" and then uglify it, you will get a smaller build than if you don’t. It’s the same one we ship as dist/react.min.js and from CDN.

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

No branches or pull requests

3 participants