|
3 | 3 | "version": "0.13.0",
|
4 | 4 | "description": "A Query Language and Runtime which can target any service.",
|
5 | 5 | "license": "MIT",
|
6 |
| - "main": "index.js", |
7 |
| - "module": "module/index.js", |
| 6 | + "main": "index", |
| 7 | + "module": "index.mjs", |
8 | 8 | "homepage": "https://github.com/graphql/graphql-js",
|
9 | 9 | "bugs": {
|
10 | 10 | "url": "https://github.com/graphql/graphql-js/issues"
|
|
28 | 28 | "prettier": "prettier --write 'src/**/*.js'",
|
29 | 29 | "check": "flow check",
|
30 | 30 | "check-cover": "for file in {src/*.js,src/**/*.js}; do echo $file; flow coverage $file; done",
|
31 |
| - "build": "npm run build:clean && npm run build:cp && npm run build:npm && npm run build:npm-flow && npm run build:module && npm run build:module-flow && npm run build:package-json", |
| 31 | + "build": "npm run build:clean && npm run build:cp && npm run build:package-json && npm run build:cjs && npm run build:mjs && npm run build:flow", |
32 | 32 | "build:clean": "rm -rf ./dist && mkdir ./dist",
|
33 | 33 | "build:cp": "cp README.md LICENSE ./dist",
|
34 | 34 | "build:package-json": "node ./resources/copy-package-json.js",
|
35 |
| - "build:npm": "babel src --optional runtime --ignore __tests__ --out-dir dist/", |
36 |
| - "build:npm-flow": "find ./src -name '*.js' -not -path '*/__tests__*' | while read filepath; do cp $filepath `echo $filepath | sed 's/\\/src\\//\\/dist\\//g'`.flow; done", |
37 |
| - "build:module": "BABEL_MODULES=1 babel src --optional runtime --ignore __tests__ --out-dir dist/module/", |
38 |
| - "build:module-flow": "find ./src -name '*.js' -not -path '*/__tests__*' | while read filepath; do cp $filepath `echo $filepath | sed 's/\\/src\\//\\/dist\\/module\\//g'`.flow; done", |
| 35 | + "build:cjs": "babel src --optional runtime --ignore __tests__ --out-dir dist/", |
| 36 | + "build:mjs": "BABEL_MODULES=1 babel src --optional runtime --ignore __tests__ --out-dir dist/module/ && for file in $(find dist/module -name '*.js'); do mv \"$file\" `echo \"$file\" | sed 's/dist\\/module/dist/g; s/.js$/.mjs/g'`; done && rm -rf dist/module", |
| 37 | + "build:flow": "for file in $(find ./src -name '*.js' -not -path '*/__tests__*'); do cp \"$file\" `echo \"$file\" | sed 's/\\/src\\//\\/dist\\//g'`.flow; done", |
39 | 38 | "preversion": ". ./resources/checkgit.sh && npm test",
|
40 | 39 | "prepublish": ". ./resources/prepublish.sh",
|
41 | 40 | "gitpublish": ". ./resources/gitpublish.sh"
|
|
0 commit comments