Support ES modules for use in Webpack2/Rollup#939
Support ES modules for use in Webpack2/Rollup#939baer wants to merge 8 commits intographql:masterfrom baer:feature/add-es-modules
Conversation
|
This PR is up to date and should work as designed :D |
| "last 2 chrome versions", | ||
| "last 2 edge versions", | ||
| "last 2 firefox versions", | ||
| "env": { |
There was a problem hiding this comment.
Note: The babel config merging strategy does not allow the common plugins to be defined at the top level. I'm investigating this babel bug and will file an issue on that project when I have a good repro.
There was a problem hiding this comment.
No, not at present. Is it blocking?
There was a problem hiding this comment.
I think the env option is broken conceptually in some ways, that's why there is still discussion to deprecate it in favor of the new .babelrc.js config coming in babel 7. That's also why there is currently no effort put into fixing all the broken cases with env.
A workaround for babel 6.x is to create a local preset and reference it in the babel config. That way you have full control about which plugin is activated in which environment by simply using javascript + environment variables.
There was a problem hiding this comment.
Wow! Thanks @danez, that's really exciting news!
| "license": "BSD-3-Clause", | ||
| "main": "index.js", | ||
| "main": "es5/index.js", | ||
| "jsnext:main": "modules/index.js", |
There was a problem hiding this comment.
@baer, jsnext:main is deprecated. Use module instead.
There was a problem hiding this comment.
Done! Thanks, I did not know that.
This PR changes the build in the following ways:
envdist/es5and adist/modulesversion of the codejsnext:mainwas addedAs of this PR, DCE from Rollup/Webpack 2+ should be supported!