You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Section sources in the generated source map (dist/index.js.map) should contain a valid path relative to the source file used to generate the bundle, relative to the position of the source map file itself, in this case ../src/index.ts
Actual Behavior
The path in sources map contains an extra ../ segment, i.e. ../../src/index.ts
Additional Information
Setting composite to true instructs the typescript compiler to copy the directory structure of the source files relative to the root dir (by default it's the tsconfig.json file location), hence it expects the source map file to be generated in dist/src/index.js.map, which does not match the path in the imported module ID.
The root cause is that the source map produced by Typescript has its path relative to the output file generated by Typescript, while the one expected by rollup should be relative to the module id (the input file in this case).
This happens to match if the input (.ts) file and the output (.js) files are in the same directory or in directories with the same path depth.
Expected Behavior
Section
sources
in the generated source map (dist/index.js.map
) should contain a valid path relative to the source file used to generate the bundle, relative to the position of the source map file itself, in this case../src/index.ts
Actual Behavior
The path in
sources
map contains an extra../
segment, i.e.../../src/index.ts
Additional Information
Setting
composite
totrue
instructs the typescript compiler to copy the directory structure of the source files relative to the root dir (by default it's thetsconfig.json
file location), hence it expects the source map file to be generated indist/src/index.js.map
, which does not match the path in the imported module ID.The root cause is that the source map produced by Typescript has its path relative to the output file generated by Typescript, while the one expected by rollup should be relative to the module id (the input file in this case).
This happens to match if the input (
.ts
) file and the output (.js
) files are in the same directory or in directories with the same path depth.See
https://github.com/rollup/plugins/blob/master/packages/typescript/src/outputFile.ts#L89
The text was updated successfully, but these errors were encountered: