Open ziyouchutuwenwu opened 7 years ago
I'm also having a terrible time getting import
s to work. I've tried numerous ways of exporting/importing my internal module, and regardless of what I try, asset compilation fails. The .ts files themselves compile just fine using tsc
, so this is something about how the asset pipeline is handling the compiled code.
How are people including other internal ts
modules when using this gem?
TypeScript::Src.use_external_tsc = true
Typescript::Rails::Compiler.default_options = %w(--target es5 --noImplicitAny --module system --sourceMap --lib es2015,dom)
class Auth {
...
}
export default Auth;
/// <reference path='./auth.ts' />
import Auth from "./auth";
../../../../var/folders/m2/3k5p0hsj4_j9r2x3yx9dbljmh8f8pr/T/typescript-node20180302-84896-8ydfhs.ts(2,18): error TS2307: Cannot find module 'Auth'.
i removed coffie-script from gemfile
routes.rb
views/welcome/index.html.erb
assets/javascripts/welcome.ts
greeter.ts in assets/javascripts/
i added this to application.rb to support multi ts files compiling
when i run rails in dev mode, here are the error snapshot![111](https://cloud.githubusercontent.com/assets/7458713/22937351/49e95646-f313-11e6-80db-576364af61b3.png)
but if a copy copy class code from greeter.ts to welcome.ts, it runs ok is this a bug? if not, how can i do?
thank you very much!