TypeStrong / grunt-ts

A grunt task to manage your complete typescript development to production workflow
https://www.npmjs.com/package/grunt-ts
MIT License
330 stars 121 forks source link

Module resolution fails when used Path mapping #423

Closed jobinesh closed 6 years ago

jobinesh commented 6 years ago

I was trying to use path mapping feature https://www.typescriptlang.org/docs/handbook/module-resolution.html . I see source compiling with 'tsc' , However when I used grunt-ts to compile same source , it fails with module not found error ("typescript": "2.4.2", "grunt-ts": "^6.0.0-beta.17",)

Using tsc v2.4.2 src/js/utils/globalConfig.ts(7,36): error TS2307: Cannot find module '@SomeModel'.

Is this feature ( defining path mapping in tsconfig.json and using it in 'import' statement) supported in grunt-ts ? or bug ?

nycdotnet commented 6 years ago

Hi - sorry for the delay. The functionality in paths is not supported by tsc from the command-line, so grunt-ts has no way to pass this value. If this were to be added to tsc, we could support it. The non-support for paths is mentioned in the source code here, but not documented in the readme, which I will fix; sorry about that oversight. If you need to use paths, you'll have to use the tsconfig.json pass-through feature of grunt-ts. See the readme for more details on that. Hope that helps.