Use es2015-loose Babel preset in production build
See original GitHub issueAlmost every React package that I’m aware of uses the loose version of the preset to transpile, given that es2015-loose
produces code that’s easier to understand and more performant.
As such, it would probably make the most sense to use es2015-loose
at least for the production Babel config. There are a few edge cases where it allows illegal code to work, so it may not be appropriate for the development config, but I think any “serious” production Babel config should be expected to use es2015-loose
rather than es2015
.
Issue Analytics
- State:
- Created 7 years ago
- Comments:37 (14 by maintainers)
Top Results From Across the Web
babel-preset-es2015-loose - npm
The preset that this project is based on, babel-preset-es2015, now supports setting the "loose" option directly.
Read more >babel/preset-env
babel /preset-env` is a smart preset that allows you to use the latest ... Enable "loose" transformations for any plugins in this preset...
Read more >babel-preset-es2015-loose-classes-and-modules - Snyk
Why do you need to install both? The idea is that babel-preset-es2015-loose-classes-and-modules will always be up to date because it will always ...
Read more >Babel preset es2015 loose not working? - Stack Overflow
I then tried adding "modules": "umd" to .babelrc to attempt1 above, and when fed with a proper strict .js file, it did produce...
Read more >Babel-preset-es2015-loose NPM | npm.io
Check Babel-preset-es2015-loose 8.0.0 package - Last release 8.0.0 with MIT ... you can remove 'es2015-loose' from your list of presets and instead use...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If we enable loose, we enable it everywhere. Having differences between dev and prod is bad.
Worth noting that as-is,
es2015
produces code that can’t run in ES5 environments without polyfills – https://phabricator.babeljs.io/T7518es2015-loose
doesn’t have this problem.