I would like to compile only the changed typescript files with grunt-ts (otherwise it would be extremely slow), but it seems that I cannot.
- I was trying to start it as a concurrent task, but in this case it seems that my normal watch is not working.
- Also tried to use watch for it, but in that case it is compiling all the files.
The only way I succeeded is to start the grunt-ts as a separate grunt process. This way it is really compiling just the changed files, but I need to start it separately
So obviously I would like to run just one grunt.
Any suggestion how I can accomplish it?
UPDATE:
What is strange, that today I changed my setting and it is working kind of well.
I have reference file for completion (above the app folder) and navigation and also my file is compiling fast enough.
Not sure how it is doing it as compile is set up as false for ts:dev (it is just for maintaining my reference file).
Also I stopped grunt to try whether something else is running. But the js files were not refreshed, so nothing else is compiling them.
Strange but it is working now as I wanted to have it. (not sure though why grunt-ts is compiling the file if I have false as default, but ...)
My config is:
ts: {
options: {
compile: false,
comments: false,
target: 'es5',
module: 'amd',
sourceMap: true,
sourceRoot: '',
mapRoot: '',
declaration: false,
noImplicitAny: false,
fast: 'never'
},
initDev: {
src: [
'<%= yeoman.app %>/**/*.ts'
],
reference: '_references.ts',
options: {
compile: true
}
},
dev: {
src: [
'<%= yeoman.app %>/**/*.ts'
],
reference: '_references.ts'
}
}
...
watch: {
ts: {
files: '<%= yeoman.app %>/**/*.ts',
tasks: ['ts:dev']
}
}
I am starting the ts:initDev when grunt starts and and running ts:dev when files changing.
UPDATE 2:
Sorry it seems that something else is compiling the files. I have set up tsc to compile in the editor setting. Which is ok.