Skip to content

Commit

Permalink
feat(pkg): build esm and cjs mods
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleygwilliams committed Nov 5, 2020
1 parent b499c0b commit e9401ec
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
5 changes: 5 additions & 0 deletions query-planner-wasm/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 10 additions & 6 deletions query-planner-wasm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
"version": "0.0.6",
"description": "Bridge code written in Rust to Javascript/Typescript, to be internally used by Apollo Gateway. This package is not meant to be independently consumed.",
"scripts": {
"wasm-pack": "wasm-pack build --target nodejs --out-dir dist --out-name index --scope apollo",
"monorepo-prepare": "npm run wasm-pack"
"build-esm": "wasm-pack build --target bundler --out-dir module --out-name index --scope apollo",
"build-cjs": "wasm-pack build --target nodejs --out-dir dist --out-name index --scope apollo",
"remove-pkg-jsons": "rm module/package.json && rm dist/package.json",
"monorepo-prepare": "npm run build-esm && npm run build-cjs && npm run remove-pkg-jsons"
},
"author": "opensource@apollographql.com",
"license": "MIT",
Expand All @@ -24,11 +26,13 @@
"apollo"
],
"files": [
"dist/index_bg.wasm",
"dist/index.js",
"dist/index_bg.js",
"dist/index.d.ts"
"dist/*",
"module/*"
],
"main": "dist/index.js",
"exports": {
"require": "dist/index.js",
"import": "module/index.js"
},
"types": "dist/index.d.ts"
}

0 comments on commit e9401ec

Please sign in to comment.