-
-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to generate .d.ts.map #564
Comments
tsup uses rollup-plugin-dts to bundle the dts files, which doesn't support generating declaration maps. You could run |
Thanks for the tip with |
github-merge-queue bot
pushed a commit
to proofcarryingdata/zupass
that referenced
this issue
Dec 12, 2023
Since `tsup` [does not support declaration maps](egoist/tsup#564) we have to use `tsc` for this. I've refactored the build commands a bit so that it's a bit easier to see what is going on. Most packages now have two `build` commands, `build:ts` and `build:types`. The first uses `tsup` to build the TypeScript and bundle the resulting JS, and the second creates type declarations and declaration maps. Some packages with separate node and browser builds have three: instead of `build:ts` they have `build:browser` and `build:node`, with `build:types` remaining the same. I have also created `dev:*` equivalents of these build commands.
github-merge-queue bot
pushed a commit
to proofcarryingdata/zupass
that referenced
this issue
Dec 12, 2023
Since `tsup` [does not support declaration maps](egoist/tsup#564) we have to use `tsc` for this. I've refactored the build commands a bit so that it's a bit easier to see what is going on. Most packages now have two `build` commands, `build:ts` and `build:types`. The first uses `tsup` to build the TypeScript and bundle the resulting JS, and the second creates type declarations and declaration maps. Some packages with separate node and browser builds have three: instead of `build:ts` they have `build:browser` and `build:node`, with `build:types` remaining the same. I have also created `dev:*` equivalents of these build commands.
mikoloism
added a commit
to wonize/biruni
that referenced
this issue
Apr 27, 2024
remove `tsup.config.ts` file, instead add `build.ts` to `scripts/` do build with tsup programatic api (`build` function) rename `scripts/release.ts` to `release-helper.ts` change behavior of `dts` function replace tsup `dts` configuration with built-in handy `tsc` commandline issued in egoist/tsup#564 (comment)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I am able to generate
.d.ts
, however in a monorepo it's also a requirement to produce.d.ts.map
files to allow jumping between files (see https://stackoverflow.com/questions/55318663/how-to-generate-d-ts-and-d-ts-map-files-using-webpack).My tsconfig enables
declarationMap
, however it doesn't seem to be respected bytsup
. Do you have an idea of how to force this parameter to be taken into account? I guess you usetsc
under the hood so that's just a matter of passing the right config.My
tsup.config.ts
:Adding:
tsconfig: path.resolve(__dirname, "./tsconfig.build.json"),
(with the config enablingdeclarationMap
) doesn't seem to work.My
tsconfig.json
:The text was updated successfully, but these errors were encountered: