Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4c6dd51

Browse files
authored
Update README.md
Add the step of installing the TypeDefinitions for typescript to make importing angular successes. Include real example for the configurations.
1 parent 9780d13 commit 4c6dd51

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,27 @@ And then execute:
3232

3333
$ bundle
3434

35+
Note: We need to install (if we haven't already) the Typescript definitions, [more info](https://github.com/DefinitelyTyped/DefinitelyTyped#how-do-i-get-them).
36+
37+
npm install --save-dev @types/node
38+
3539
## Usage
3640

3741
Just add a `.js.ts` file in your `app/assets/javascripts` directory and include it just like you are used to do.
3842

3943
Configurations:
4044

4145
```
42-
# Its defaults are `--target ES5 --noImplicitAny`.
43-
Typescript::Rails::Compiler.default_options = [ ... ]
46+
Typescript::Rails::Compiler.default_options = %w(--target ES5 --noImplicitAny --module commonjs)
4447
```
4548

49+
Default Configurations:
50+
51+
```
52+
Typescript::Rails::Compiler.default_options = %w(--target ES5 --noImplicitAny)
53+
```
54+
55+
4656
## Default Javascript Compilation
4757

4858
Add this line to your `config/application.rb` as show below, above the `config.assets.enabled = true`:

0 commit comments

Comments
 (0)