requirejs - How to import a TypeScript file from another directory? -
this code works fine:
import modal = require('./modal');//modal path class index{ constructor(){ var_modal = new modal(); } } export = index
if change require path "../../widgets/personinfo/viewmodel"
, after rebuild solution visual studio gives error:
unable resolve external module "../../widgets/personinfo/viewmodel", build: module cannot aliased non-module type, invalid 'new' expression
the problem found. folder name starting uppercase, while require path all-lowercase.
valid code:
import modal = require('../../widgets/personinfo/viewmodel')
Comments
Post a Comment