Skip to content

Commit 78988fc

Browse files
committed
Merge pull request #204 from nycdotnet/Fix-194
Re-integrate custom compiler documentation.
2 parents eeaa3f3 + 053595e commit 78988fc

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,9 @@ grunt.initConfig({
315315

316316
This target option allows the developer to select an alternate TypeScript compiler.
317317

318-
To use the alternate compiler that is included with grunt-ts, update your gruntfile.js file with this code:
318+
By default, `grunt-ts` will use the TypeScript compiler that came bundled with it. Alternate compilers can be used by this target option (for custom compiler builds) or using `package.json` (for npm released version of `typescript`).
319+
320+
To use a custom compiler, update your gruntfile.js file with this code:
319321

320322
````javascript
321323
grunt.initConfig({
@@ -327,7 +329,24 @@ grunt.initConfig({
327329
});
328330
````
329331

330-
To use another compiler version, download it from the current [TypeScript repository on GitHub](https://github.com/Microsoft/TypeScript/releases) or the old [TypeScript repository on CodePlex](http://typescript.codeplex.com/releases) and extract it to a folder in your project. The compiler will be in the `bin` folder. Copy all of the files to your project folder and then reference `tsc` using the `compiler` task option. For example, if you extracted everything to a `mycompiler` folder in your project, you'd set the grunt-ts `compiler` property to `'./mycompiler/tsc'`.
332+
Download custom compilers from the current [TypeScript repository on GitHub](https://github.com/Microsoft/TypeScript/releases) or the old [TypeScript repository on CodePlex](http://typescript.codeplex.com/releases) and extract it to a folder in your project. The compiler will be in the `bin` folder. Copy all of the files to your project folder and then reference `tsc` using the `compiler` task option. For example, if you extracted everything to a `mycompiler` folder in your project, you'd set the grunt-ts `compiler` property to `'./mycompiler/tsc'`.
333+
334+
In the absence of a compiler argument, `grunt-ts` will look for an alternate compiler in its *peer* `node_modules` folder (where `grunt-ts` and `typescript` are peers).
335+
336+
The `package.json` would look something like this for a legacy project:
337+
338+
```javascript
339+
{
340+
"devDependencies": {
341+
"grunt" : "~0.4.1",
342+
"grunt-ts" : "~1.9.2",
343+
"typescript" : "0.9.7"
344+
}
345+
}
346+
```
347+
Note: It is safest to pin the exact TypeScript version (do not use `~` or `>`).
348+
349+
331350

332351
#### noResolve
333352

0 commit comments

Comments
 (0)