It enables you to use the
.ts extension in the Asset Pipeline and also in ActionView Templates.
This gem uses the typescript-node-ruby library by KAWACHI Takashi for the typescript parsing with node js.
The credit for the overall structure and the tests goes to the people that wrote the coffee-rails Gem, since I shamelessly copy&pasted some of their code.
The current version requires that node.js is installed on the system.
The requirement for node is tested upon starting the application. If the node command is not available you get the following error message:
typescript-node requires node command, but it's not found. Please install it. Set TS_NODE environmental variable If you want to use node command in non-standard path.
Add this line to your application's Gemfile:
And then execute:
Just add a
.js.ts file in your
# Its defaults are `--target ES5 --noImplicitAny`. Typescript::Rails::Compiler.default_options = [ ... ]
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request
FUJI Goro email@example.com
Klaus Zanders firstname.lastname@example.org