Skip to content
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

Don't use mjs for module dist yet #33

Merged
merged 1 commit into from
Mar 4, 2019

Conversation

peteruithoven
Copy link
Contributor

See: #32

This is the easiest solution to fix issues with default config of Webpack. Background:

Files ending with .mjs are parsed as javascript/esm, a stricter mode. This mode does not allow to import CJS modules like ESM ones.

While this issue looks like a webpack one, it is not: react-apollo should correctly import non-ESM dependencies, in this case react.

From: apollographql/react-apollo#1737

Just remember Webpack's defaults are the way they are for a reason. .mjs is limited because it's not fully baked and it's support story isn't finished yet. If you need javascript/auto you should really be using .js.

From: apollographql/react-apollo#1737 (comment)

I think this is a better solution than having people customize their webpack config, especially since webpack's is trying to be zero config and people using tools like create-react-app, vue-cli who might not even realize that they are using webpack.

Ideally d3-array, d3-collection, and d3-shape start including a es format es well, but that will take time.

@peteruithoven
Copy link
Contributor Author

Thanks @tomshanley!

@tomshanley
Copy link
Owner

I'll update npm later on this evening

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants