0

I try to separate Angular 2 module I created and import it back to app using npm, but I keep running into problems with it. Right now I'm stuck with error TS2307: Cannot find module 'preloader' I added

"paths": {
  "preloader": ["../node_modules/angular2-resource-preloader/dist/"]
}

to my tsconfig and dist folder contains .d.ts files. I also added "types" property to module package.json, but I keep getting error TS2307.

K. Kowalczyk
  • 967
  • 13
  • 34

1 Answers1

0

Thanks to @Und3rTow I researched TS documentation more, and found out that with "moduleResolution": "node" I have to add path to module, not folder with main files. So correct path in my case is "../node_modules/angular2-resource-preloader/".

Thank you for assistance.

K. Kowalczyk
  • 967
  • 13
  • 34