So, I am using webpack2 in an Angular2 project that has several external dependencies. Some of these dependencies use commonjs and declare components, as shown below:
@Component({ moduleId: module.id, templateUrl: 'mycomponent.html' ... })
This results in the error below:
Error: moduleId should be a string in "MyComponent"
After some research, I realized that this is because Webpack expects components to have id as a number, and Angular will declare it as a string. I cannot change the dependency code. What can I do to live with such an addiction?
Thanks!
source share