Skip to content

Commit ccf5f55

Browse files
committed
Added section to clarify compiler override
simplified installation paragraph made small language fix should help with #66 fixed typo
1 parent b690f70 commit ccf5f55

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

README.md

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ Following are the reasons why grunt-ts was created:
88

99
- Written in [TypeScript](https://github.com/grunt-ts/grunt-ts/blob/master/tasks/ts.ts)
1010
- Enables a TypeScript development workflow in addition to simple file compilation.
11-
- Super simple to update to the [latest version of the TypeScript](https://github.com/grunt-ts/grunt-ts/commit/ffede564f2b20bc4dc207cb1a30dc57db7c44fe5)
11+
- Supports overriding the bundled compiler with an alternate version.
1212

1313
Check how grunt-ts can help streamline front end development: [Sample usage with AngularJS](http://www.youtube.com/watch?v=0-6vT7xgE4Y&hd=1)
1414

1515
Additional / longer / more basic video tutorial: http://youtu.be/Km0DpfX5ZxM
1616

1717
For a quickstart see the full featured [Gruntfile](https://github.com/grunt-ts/grunt-ts/blob/master/sample/Gruntfile.js).
1818

19-
## Following are some key features:
19+
## Key features
2020

2121
### Compiler support
2222

@@ -169,30 +169,38 @@ Grunt-ts can watch a directory and recompile TypeScript files when any TypeScrip
169169

170170
Grunt-ts is published as [npm package](https://npmjs.org/package/grunt-ts):
171171

172+
For new projects make sure to have installed nodejs, then install grunt-cli:
173+
172174
````bash
173-
$ npm install grunt-ts --save-dev
175+
$ npm install -g grunt-cli
174176
````
175177

176-
For new projects and user new to node, make sure to have installed nodejs, then install grunt-cli:
178+
Install the and save to `package.json` devDependencies:
177179

178180
````bash
179-
$ npm install -g grunt-cli
181+
$ npm install grunt-ts --save-dev
180182
````
181183

182-
Next install `grunt` and `grunt-ts` by creating a `package.json` file containing the following:
184+
### Alternate compiler version
185+
186+
Support for both legacy or cutting-edge projects can be enabled using the compiler override:
187+
188+
At runtime the plugin will look for an alternate compiler in the same `node_modules` folder. To use a different version of the TypeScript compiler install the required `typescript` version as a *peer* of `grunt-ts`. If no override was found the bundled compiler is used.
189+
190+
The `package.json` would look something like this for a legacy project:
183191

184192
```javascript
185193
{
186194
"devDependencies": {
187-
"grunt" : "0.4.1",
188-
"grunt-ts" : "latest"
195+
"grunt" : "~0.4.1",
196+
"grunt-ts" : "~1.7.2",
197+
"typescript" : "0.9.1-1",
189198
}
190199
}
191200
```
192-
Then run `npm install` from the same directory. This will download both grunt and grunt-ts.
193-
201+
Note: make sure to pin the exact TypeScript version (do not use `~` or `>`).
194202

195-
## Configuration Documentation
203+
## Configuration
196204

197205
Create a `Gruntfile.js`. Modify it to load grunt-ts by adding the following lines:
198206

0 commit comments

Comments
 (0)