You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-11Lines changed: 19 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,15 +8,15 @@ Following are the reasons why grunt-ts was created:
8
8
9
9
- Written in [TypeScript](https://github.com/grunt-ts/grunt-ts/blob/master/tasks/ts.ts)
10
10
- 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.
12
12
13
13
Check how grunt-ts can help streamline front end development: [Sample usage with AngularJS](http://www.youtube.com/watch?v=0-6vT7xgE4Y&hd=1)
14
14
15
15
Additional / longer / more basic video tutorial: http://youtu.be/Km0DpfX5ZxM
16
16
17
17
For a quickstart see the full featured [Gruntfile](https://github.com/grunt-ts/grunt-ts/blob/master/sample/Gruntfile.js).
18
18
19
-
## Following are some key features:
19
+
## Key features
20
20
21
21
### Compiler support
22
22
@@ -169,30 +169,38 @@ Grunt-ts can watch a directory and recompile TypeScript files when any TypeScrip
169
169
170
170
Grunt-ts is published as [npm package](https://npmjs.org/package/grunt-ts):
171
171
172
+
For new projects make sure to have installed nodejs, then install grunt-cli:
173
+
172
174
````bash
173
-
$ npm install grunt-ts --save-dev
175
+
$ npm install -g grunt-cli
174
176
````
175
177
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:
177
179
178
180
````bash
179
-
$ npm install -g grunt-cli
181
+
$ npm install grunt-ts --save-dev
180
182
````
181
183
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:
183
191
184
192
```javascript
185
193
{
186
194
"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",
189
198
}
190
199
}
191
200
```
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 `>`).
194
202
195
-
## Configuration Documentation
203
+
## Configuration
196
204
197
205
Create a `Gruntfile.js`. Modify it to load grunt-ts by adding the following lines:
0 commit comments