ivogabe / gulp-typescript

A TypeScript compiler for gulp with incremental compilation support.
MIT License
831 stars 129 forks source link

Sourcemap always on in .d.ts files. #596

Closed StaticSaltByte closed 5 years ago

StaticSaltByte commented 5 years ago

Expected behavior: Setting sourceMap: false when using ts.createProject('tsconfig.json') or ts.createProject({ ... }) should prevent sourcemaps from being added to generated .d.ts files.

Actual behavior: Changing the sourceMap value does not appear to have any effect. Adding the configuration to tsconfig.json or passing it as an option when calling ts.createProject() did not have any obvious effect.

Gulpfile excerpt:

// Used for producing Javascript
const tsProject = ts.createProject('tsconfig.json', {
    typescript: typescript,
});

// Used for producing .d.ts files
const tsProject2 = ts.createProject('tsconfig.json', {
    typescript: typescript,
    removeComments: true,
    declaration: true,
    sourceMap: false,
    module: 'none'
});

Aditional info: This bug appeared after upgrading to gulp-typescript 5.0.0-alpha.3 from a much older version. Downgrading to 4.0.2 fixed the problem.

Finally, I was using TypeScript 3.1.1 for all versions of gulp-typescript and all other project dependencies were also consistent throughout the upgrade process.