Search code examples
angularwebstormbundling-and-minificationangular2-build

Module not found while bundling Angular 2 project using Webpack


I'm using WebStorm 2016.3 to create an Angular 2 Project. I've followed this post to bundle my project: https://angular.io/docs/ts/latest/guide/webpack.html

When I typed command npm start it showed me a list of errors:

Module not found

I've changed templateUrl in every file to src/components/<template url> but it still showed those errors.

Can anyone help me please ?


Solution

  • try this: ../views/main-application.html

    The url is starting relative to the current path of your .ts file. So you need to navigate up first.