typescript-ruby / typescript-rails

An asset pipeline wrapper for the TypeScript language
MIT License
255 stars 29 forks source link

Change compiler default options #22

Closed FlavienBusseuil closed 9 years ago

FlavienBusseuil commented 9 years ago

I'm wondering how can I change the default compiler options set in compiler.rb (those described in the readme) :

Its defaults are --target ES5 --noImplicitAny.

Typescript::Rails::Compiler.default_options = [ ... ]

To this day, I used to directly change the source file, and that's working. But I'm looking for a proper way of doing that, without changing the gem sources files directly, maybe some how in my rails project.

paulrosen commented 9 years ago

I may be misinterpreting what you are asking, but inside my /config/initializers folder in my Rails project, I have the file typescript.rb, which contains:

Typescript::Rails::Compiler.default_options = [
    '--target', 'ES5',
#   '--noImplicitAny'
]
FlavienBusseuil commented 9 years ago

Oh cool, I was simply not aware of the /config/initializers mechanism. :) Thanks for your answer!