Skip to content

Commit

Permalink
use the typesVersions trick to allow multiple entry points
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-burel committed Oct 1, 2021
1 parent 1d78ba1 commit b1f2073
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 2 additions & 4 deletions packages/graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@
".": "./dist/index.js",
"./server": "./dist/server/index.js"
},
"types": "./dist/index.d.ts",
"typesVersions": {
"*": {
"./": [
"./dist/index.d.ts"
],
"./server": [
"server": [
"./dist/server/index.d.ts"
]
}
Expand Down
8 changes: 8 additions & 0 deletions packages/mongo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@
".": "./dist/index.js",
"./client": "./dist/client/index.js"
},
"types": "./dist/index.d.ts",
"typesVersions": {
"*": {
"client": [
"./dist/client/index.d.ts"
]
}
},
"author": "eric-burel <eb@lebrun-burel.com>",
"homepage": "https://github.com/VulcanJS/vulcan-npm#readme",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/mongo/webpack.config.client.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ module.exports = merge(baseConfig, {
entry: path.resolve(__dirname, "./client/index.ts"),
output: {
// NOTE: @vulcanjs/mongo is a server-first package, so to get isomorphic code you need to import @vulcanjs/mongo/client
path: path.resolve(__dirname, "dist"),
path: path.resolve(__dirname, "dist/client"),
},
});

0 comments on commit b1f2073

Please sign in to comment.