gulp-typescript icon indicating copy to clipboard operation
gulp-typescript copied to clipboard

Incorrect source map with multiline template string

Open dhilgarth opened this issue 7 years ago • 1 comments

Expected behavior: Source map maps the single line string in the generated javascript file to all lines of the original string Actual behavior: It only maps the the line with the opening backtick. Visualization Your gulpfile: https://github.com/ivogabe/gulp-typescript-sourcemaps-demo/blob/1e6ce74f47af958dca4014d274f4e330e3f0fb47/gulpfile.js

tsconfig.json https://github.com/ivogabe/gulp-typescript-sourcemaps-demo/blob/1e6ce74f47af958dca4014d274f4e330e3f0fb47/src/tsconfig.json

Code

alert(`I am
multiline
with
many
lines
`);


alert("I am\n" + 
"multiline\n" + 
"with\n" + 
"many\n" + 
"lines\n"
);

This issue manifests itself if a previous step created a source map. I have implemented source map support for gulp-inline-ng2-template and I have verified the generated source maps via source-map-visualizer and they seem to be correct. However, the source maps generated at the end of the build are incorrect, and I assume it is because of this issue.

dhilgarth avatar May 24 '18 13:05 dhilgarth

Strange, it could be some issue with source-map which we use to combine the two sourcemaps. I updated its version in the latest release, could you try that? You can install it with npm install [email protected]

ivogabe avatar Jun 11 '18 20:06 ivogabe