VS 2015 Typescript modules support -


has had luck new modules support in vs2015 , typescript 1.5? wrote quick example has 1 module "main.ts" importing "lib" , calling 2 test functions.

when compile in vs2015 gives me compiler error on lib.ts need specify --module flag.

lib.ts

export function func1() {      console.log("func1 called");  }  export function func2() {     console.log("func2 called"); } 

main.ts

import * thelib "lib";  module main {      export function someworkhere() {          console.log("someworkhere called");         thelib.func1();         thelib.func2();     } } 

i have verified module system "on". (i tried amd, commonjs, umd) same compiler results.

so: tried running tsc (typescript compiler) command line , compiles fine!

has experienced this? ideas on how bend ide will?

when adjust project settings, need each configuration running. you'll change in "debug" , when switch "release" stops working, because hasn't got setting.

configuration modes

additionally, if have been following typescript while, may find path variable has path old version. make sure have 1 path typescript compiler , make sure latest one.

finally, if project has been around while, make sure typescript tools version correct. you'll find in project file:

<typescripttoolsversion>1.5</typescripttoolsversion> 

other these items - dropped code new project , compiled fine.


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -