-
Notifications
You must be signed in to change notification settings - Fork 208
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
.default is back in 8.0 #238
Comments
Ouch, sorry about that. I see why this would be painful in a project mixing commonjs requires and es imports. I've tried to find a solution to this but I'm coming up short. Do you know of any libraries out there that publish both a |
The thing is we're not actually mixing them - our codebase is 100% CommonJS. The problem is that webpack doesn't play nice. 😞 Given the current state of the ecosystem I think the only safe way to ship both ESM and CJS in the same package is to not have any default exports. If every export is a named export things work as expected. |
Unfortunately adding the
modules
property to package.json in #234 brought #221 back. We're using webpack 3.10.0This is especially painful when trying to use both Node.js for server side rendering and the browser.
I fixed this by adding
mainFields: ['browser', 'main']
to our webpack config though that's obviously not optimal.The text was updated successfully, but these errors were encountered: