-
Notifications
You must be signed in to change notification settings - Fork 54
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
Handle incompatibility with Webpack #39
Comments
Hi, @esphen This is an interesting bug. With webpack output, why it use /* harmony default export */ exports["a"] = _default; // exports = Object {} |
I honestly don't know. If you want an answer to that you probably need to get in touch with someone who works on webpack. I'm not a webpack developer, so I don't have the definitive answers, but I had a look at the Webpack source to try to help. On the face of things, assigning
That's how it becomes |
More strange here. In the webpack example, the My personal feeling is, webpack@2 is awesome to natively support ES6 @59naga You ideas? |
Shoot, my bad. I missed that!
Be aware that this is only an issue if you disable babel's module compilation with But on a general basis I totally agree that giving some sort of message why it is breaking is good. But can we do it without breaking it for people who for whatever reason can not, or do not want to use |
The Babel option "modules: false" can't be used with the add-module-exports, which is needed for Calypso to compile. This means we can't take advantage of WebPack2 tree-shaking yet, thus adding 50KB to the JS bundle. More info: 59naga/babel-plugin-add-module-exports#39 (comment) Automattic/wp-calypso#10799 Automattic/wp-calypso#11204
I met this problem too... |
Hi,
First of all, thanks for a pretty cool plugin.
I must admit I am a little disappointed to see that this plugin was the cause of my two day grief of trying to get Webpack 2 tree-shaking to work. You see, it is incompatible with Webpack 2 when it uses native ES6 modules. In fact, it breaks the entire website when you try to use it. Have a look at this StackOverflow post I created for posterity for details. I also created a tiny reproduction repository you can find here if you want to see it for yourself.
If possible, I would like to make a suggestion for a feature that can save other people the pain I went through. Is it possible for you detect the usage of Webpack 2 with native ES6 modules somehow and handle this better?
The text was updated successfully, but these errors were encountered: