0

This is my tsconfig.json

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false,
    "outDir": "wwwroot/app/source/"
  },
  "exclude": [
    "node_modules",
    "bower_components",
    "wwwroot",
    "typings/main",
    "typings/main.d.ts"
  ]
}

As you can see the sourceMap option is set to true, this is because I need it to debug my application.

But I need it only in debug mode so that I would like to set it to false when I run my release mode gulp script.

Is there any way to force --sourceMap=fase?

Praveen Kumar K S
  • 3,024
  • 1
  • 24
  • 31
user3471528
  • 3,013
  • 6
  • 36
  • 60

1 Answers1

2

can you past example of code of your gulp tasks - gulp, gulp dist?

I suggest you should use the plugin gulp-typescript and in gulp watch (default dev task) use him with plugin gulp-sourcemaps. In gulp dist (or whatever task) you simply skip the gulp-sourcemaps pipeline, so in dist version you will have no sourcemaps.

Or you can simply use two different tsconfig files - dev / prod. And use them like gulp-typescript#using-tsconfigjson

jukben
  • 1,088
  • 7
  • 16