ES Module isn't transpiled except for import/export
AndyOGo opened this issue · comments
I expect to import an ES Module and bundle it with Webpack/Rollup/Parcel without the need to transpile react-act
itself by Babel.
I'm talking about the provided module
field as definied by the spec below:
Line 14 in 4715d36
This bug was introduced with 1.7.8
pkg.module
will point to a module that has ES2015 module syntax but otherwise only syntax features that the target environments support.
https://github.com/rollup/rollup/wiki/pkg.module
Wait, it just means import and export – not other future JavaScript features?
Yes. ...
https://github.com/rollup/rollup/wiki/pkg.module#wait-it-just-means-import-and-export--not-other-future-javascript-features
Babel allows you to disable just module syntax transpilation:
https://babeljs.io/docs/en/babel-preset-env#modules
And Rollup, Webpack etc can be configured to target a specific module syntax.
My bad, I messed up there. The change has been rollbacked in 1.7.9. Will take more time to check how to add it back correctly. Thanks both for pointing it out.
@pauldijou looks good to me.
@pauldijou awesome! yeah babel's modules
field is a perfect option
Cool, released in 1.8.0