Closed kettanaito closed 5 months ago
info.map
contains the invalid sourcesContent
as early as this line:
https://github.com/egoist/tsup/blob/8c26e63c92711d60c05aedd3cdc358530ba266c5/src/plugin.ts#L146
Found the root cause. I had a custom plugin that was modifying the outputted chunks. Since with sourcemap: true
sourcemaps also became outputted chunks, the plugin was modifying them also, resulting in invalid sourcemaps. Not an issue of tsup.
Reproduction steps
tsup: 8.0.1
node: v18.17.0
tsup.config.ts
. Add thesourcemap: true
option to the first config.pnpm install
(please use pnpm v7.12).pnpm build
.See the following error printed by tsup:
Inspecting the problematic
info.map
reveals the problem:The
sourcesContent
key contains a string that opens with double quotes"
but ends with a single quote'
, causing invalid JSON and failing the sourcemap generation.Upvote & Fund