Closed daslicht closed 8 years ago
Consider something like this in your gruntfile:
ts: {
compileClient : {
src: ["**/*.client.ts", "!node_modules/**/*.ts"]
},
compileServer : {
src: ["**/*.server.ts", "!node_modules/**/*.ts"]
}
}
You'd then be able to run grunt ts:compileServer
or grunt ts:compileClient
and it compile the appropriate set of files. To make Atom leave the files alone, you can disable compile on save - see here: https://github.com/TypeStrong/atom-typescript/blob/master/docs/tsconfig.md#compileonsave
Uhh Oh thats the missing link.
disable compile an save!
Does that also prevent Atom from showing the warning that the files are missing in the tsconfig ?
eg:
My current plan was to use browserify to bundle the client ts files. Will Grunt-ts also bundle the imports into one file so that I can use it in the browser? How would I have to load them ? Do I need a Loader like SystemJS or could I just use them like a browserify bundle?
Thank you !
Just tested :
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"sourceMap": true
},
"atom": {
"rewriteTsconfig": true,
"buildOnSave": false
}
}
no more compiler warnings :) I am going to try Grunt later when having more time
Thank You !
Note: compileOnSave
under compilerOptions
is the one you want. buildOnSave
defaults to false already. compileOnSave
controls "save one .ts file, emit one .js file". buildOnSave
controls "save one .ts file, emit all the .js files".
Thank you !
Hi, lets say we have the following naming schema of files:
Is it possible to compile to just compile all .server.ts files and leave the .client.ts files untouched ?
related: http://stackoverflow.com/questions/36436676/how-to-compile-all-files-with-the-extension-server-ts-only