forked from graphql/express-graphql
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
e8380dc
commit 890fc03
Showing
3 changed files
with
129 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module.exports = { | ||
presets: [ | ||
[ | ||
'env', | ||
{ | ||
modules: process.env.ESM ? false : 'commonjs', | ||
targets: { | ||
node: require('./package.json').engines.node.substring(2), // Strip `>=` | ||
}, | ||
}, | ||
], | ||
], | ||
plugins: ['transform-class-properties', 'transform-flow-strip-types'], | ||
ignore: ['__tests__'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.