Actual behavior:
Different maps if manually invoked or from gulp.
I already posted this issue https://github.com/gulp-sourcemaps/gulp-sourcemaps/issues/377 here, where the author said that it was an issue with tsProject. Because it is based on the examples provided by gulp-typescript, I wanted to repost the issue here.
The issue I'm having is that manually invoking the transpiler results in different sourcemaps than using gulp.
Files:
tsconfig.base.json
{
"compileOnSave": false,
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"moduleResolution": "node",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"sourceMap": true,
"pretty": true,
"strictNullChecks": true,
"skipLibCheck": true,
"strictPropertyInitialization": true,
"outDir": ".nowhere", // Bogus value; this config should not be used to transpile.
// "rootDir": "src",
"allowJs": true
}
}
As you can see, the sources of the gulp-transpile command are plain wrong, but the ones generated by tsc aren't. I'm at a total loss of what I'm doing wrong, and any pointers would be greatly appreciated. The complete project that I'm using for testing can be found here: https://github.com/MagicLegend/ts-testing-project
In the actual project I am also having issues with that all the source files are located in server/src, which confuses the source map generation even more (it adds a server/ to the sources path...)
Expected behavior: Correct sourcemaps
Actual behavior: Different maps if manually invoked or from
gulp
.I already posted this issue https://github.com/gulp-sourcemaps/gulp-sourcemaps/issues/377 here, where the author said that it was an issue with
tsProject
. Because it is based on the examples provided bygulp-typescript
, I wanted to repost the issue here.The issue I'm having is that manually invoking the transpiler results in different sourcemaps than using
gulp
.Files:
tsconfig.base.json
tsconfig.json
tsconfig.dev.json
Gulpfile.js
When using the
gulp transpile
command:Source location: src/index.ts Transpiled location: bin/index.js Mapping file location: bin/index.js.map
When using
tsc --p tsconfig.dev.json
command:Source location: src/index.ts Transpiled location: bin/index.js Mapping file location: bin/index.js.map
As you can see, the
sources
of thegulp-transpile
command are plain wrong, but the ones generated bytsc
aren't. I'm at a total loss of what I'm doing wrong, and any pointers would be greatly appreciated. The complete project that I'm using for testing can be found here: https://github.com/MagicLegend/ts-testing-projectIn the actual project I am also having issues with that all the source files are located in
server/src
, which confuses the source map generation even more (it adds aserver/
to thesources
path...)Any help is much appreciated!