-
Notifications
You must be signed in to change notification settings - Fork 3
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
Babel natively supports this now #8
Comments
That's pretty interesting, perhaps this would be the perfect solution:
|
I'm honestly not sure if turning on loose mode would be a good idea, even after reading this article: |
Yeah after looking at what Alex had to say about loose mode I agree with you about it not being a good idea at all here. That being said, I'll roll-out the new version with:
implemented. |
You should deprecate this package actually – the recommended approach now is for users to directly use the preset with options, to have more flexibility in e.g. not having to pull down yet another npm dependency just to add loose mode. |
Wouldn't the above configuration also break ES2015 modules for stuff that currently still needs to transpile modules? E.g. consider |
@avindra & @taion thank you gentlemen for the heads up and recommendation as per which I've deprecated this package in favour of the proper implementation.
while also advising users to abandon it. @Kdex After a week of testing I'm fairly confident that the replacement implementation is producing exactly the same results as the old way did and as such there should not be any differences being experianced by the end user. I will now close this issue but please feel free to reopen it should you still find a need to do so. |
@bartekus I've tested this, too. If your build pipeline doesn't contain any processes whose configurations need to be transpiled themselves, you're fine. But as soon as you instruct babel not to transpile any modules, such processes will fail, since Give it a try; disable module transpilation in your |
@Kdex I had the same problem with my tests via .babelrc {
"presets": [
"react",
["es2015", {"modules": false}]
],
"env": {
"test": {
"plugins": ["transform-es2015-modules-commonjs"]
}
}
} Maybe you can do something similar for gulp. |
What about CLI usage? I want to compile both a version with plan ES5 and one with ES5 + ES modules. It doesn't appear that you can pass options to a preset via the CLI interface (please say I'm wrong). So the next best option is:
|
Check this most recent change:
https://github.com/babel/babel/blob/master/CHANGELOG.md#loose-and-modules-options-for-babel-preset-es2015-3331-3627
I think you should updated this package to use :
And encourage other users to do the same on the readme. What do you say?
The text was updated successfully, but these errors were encountered: