-
Notifications
You must be signed in to change notification settings - Fork 213
Remove targets from library preset to force es2015 target #1322
Remove targets from library preset to force es2015 target #1322
Conversation
Re-tagging for review to see if we can get approval or changes. |
I'm a little hazy on this area, since it's been a while since I thought about #1279, but in that issue I believe the main problem was that The addition of the readme note in this PR address the final point of that, however the change to force all transforms seems to not be required, or at least orthogonal, given that the target of IE9 already activated most transforms, and that's why the pollyfill was required in the first place? It seems that we need to decide the following:
Re the PR implementation as-is, I think the library readme's "Preset Options" section would also need updating for the new default options. |
Found this in the Babel docs for env:
By not specifying any targets, it will compile to ES5 by default. I think that means we don't need the force transformation. We unfortunately can't output 2 builds unless there are 2 compilations, and this is controlled by the user's For the polyfill, we can prompt the user for it during create-project installation if you think that is a good path. I am still cautious to go down this route. |
fd49430
to
8e76d81
Compare
Perhaps |
It may be possible, but we would need a way to pass the preset twice with a different variation: module.exports = neutrino().webpack();
// Should return [libraryWithMain, libraryWithModuleAndWithoutClean] |
I think we should explore better multiple configuration experience in a feature branch after v9. I may have some ideas, but I don't think it should block this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also make it easier to override targets
? (Like is possible with the web preset)
At the moment doing so requires quite a bit of boilerplate (see example in #1279 (comment)).
8e76d81
to
be7801d
Compare
@edmorley I added |
Looks good :-) |
Fixes #1279.
Just an initial implementation; happy to change if this seems incorrect.