Correct setup for subpath-imports for internal and external packages #586
Unanswered
mgandolfi7
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have internal and external packages (published to npm but also consumed internally) in my monorepo and I'm confused about the correct way to setup subpath imports with tsdown. In my internal packages that are not published to npm, I am using tsc and setup my package.json like so:
{ "name": "@repo/internal-package", "private": true, "version": "0.0.0", "type": "module", "scripts": { "dev": "tsc --watch", "build": "tsc" }, "imports": { "#*": "./dist/*" }, "exports": { "./*": { "types": "./src/*.ts", "default": "./dist/*.js" } }, }For external packages that are consumed and published to npm, I'm using tsdown with the following configs:
{ "name": "@morpheus-sdk/contracts", "private": false, "version": "0.0.0", "type": "module", "scripts": { "build": "tsdown", "dev": "tsdown --watch" }, "imports": { "#*": "./src/*" }, }and my tsdownconfig.ts:
The above config works but I have a few questions:
tsc?Thanks!
Beta Was this translation helpful? Give feedback.
All reactions