question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use es2015-loose Babel preset in production build

See original GitHub issue

Almost 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:closed
  • Created 7 years ago
  • Comments:37 (14 by maintainers)

github_iconTop GitHub Comments

4reactions
gaearoncommented, Jul 26, 2016

If we enable loose, we enable it everywhere. Having differences between dev and prod is bad.

3reactions
taioncommented, Jul 28, 2016

Worth noting that as-is, es2015 produces code that can’t run in ES5 environments without polyfills – https://phabricator.babeljs.io/T7518

es2015-loose doesn’t have this problem.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found