2

We are using Grunt to compile and concatenate our typescript files into a single javascript file located in our distribution folder. That functionality is working properly, but Grunt also creates .map and .js files for every ts file it finds; auto-generating them in the same location as the TS files.

Is there a way to prevent grunt from making these extra files and just generate the output.js and output.map?

This is a snip of our grunt.js file.

    ts: {
      task : {
        src: ["**/*.ts", "!node_modules/**/*.ts"],
        out: 'app/dist/app.js'
      },
        options: {
            fast: 'never'
        }
    },
    watch: {
        typescript: {
            files: '**/**/*.ts',
            tasks: ['ts']
        },
        sass: {
            files: '**/**/*.scss',
            tasks: ['sass']
        }
    }
  • It seems the sourceMap option set to false would prevent generating the map files. As for individual js files, I never noticed it (did not pay attention to be correct). A clean task could be a work-around? – Hugues Stefanski Mar 12 '15 at 19:08

2 Answers2

1

In tsconfig.json turn off the compileOnSave option to signal to IDEs not to generate all files for a given configuration upon saving:

{
    "compileOnSave": false
}

Not all IDEs currently obey the option. See https://www.typescriptlang.org/docs/handbook/tsconfig-json.html for more detail.

None
  • 5,491
  • 1
  • 40
  • 51
0

It seams that your IDE is compiling your TS files.

It happens with me once with webstorm,

Witch IDE are you using?

Try to disable typescript compiler.

In case you are using webstorm:

Ctrl+Alt+S

Search for typescript under Languages & Frameworks

uncheck "Enable TypeScript Compiler" checkbox
z0r0
  • 666
  • 4
  • 14