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
Webpack 2 + System.import: default export has to be read with .default #2188
Comments
Hm, I just noticed that this basically has the same behavior as Thus, I suppose this is only a documentation (or expectation) issue. |
@Kovensky , I use this plugin to solve this problem: https://github.com/59naga/babel-plugin-add-module-exports |
Yep, working as intended. |
I don't recommend this. babel had good reasons for no longer doing so. |
This issue was moved to webpack/webpack.js.org#122 |
Snippet demonstrating the issue:
The following code gets generated in webpack's chunk containing
test.js
:This behaves differently from when you use
import Test from './test'
, as when you use such a static import you can then callnew Test()
instead of having to callnew Test.default()
.I also considered this might be an issue with babel transforms, but as it is getting emitted as a
/* harmony default export */
, I don't believe babel is transforming the export. I am using thees2015-webpack
preset to preserve harmony imports/exports.Not sure if this a webpack 2 bug or just a documentation issue.
The text was updated successfully, but these errors were encountered: