-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Use .mjs for module code #1244
Use .mjs for module code #1244
Conversation
Looks like we'll also need iterall to support mjs |
Is there a reason why the import { GraphQLError } from 'graphql/error' |
I've been trying to discourage keying deeply into the package contents, which should be implementation details, but you're right that it's no longer necessary if the files would have different extensions |
Just released https://github.com/leebyron/iterall/releases/tag/v1.2.0 which helps unblock this |
* Writes .mjs instead of .js for esmodules code. * Moves .mjs out of ./module into the top level since it no longer conflicts with .js Fixes #1217
Relates to graphql#425. - Swapped deprecated babel-preset-es2015 for babel-preset-env. - Added package.json engines field. - Configured babel-preset-env to target the Node.js version defined in package.json engines field. - Kept Babel at v6, but moved config into a v7 ready .babelrc.js file for dynamic config via env. - Tidied the package.json scripts, added an ESM build step that generates .mjs dist files. Follow the lead of graphql/graphql-js#1244, although I do things quite different for my own projects with Babel v7. - Updated package.json main field for ESM/CJS cross compatibility. - Added a package.json module field for tree-shaking bundlers.
This broke bundling with webpack: #1536 |
Fixes #1217