I'm having a bit of trouble transitioning my angular 2 application into production. It seems to be searching for scripts within the node_modules directory.
I'm fairly new to angular 2 and despite spending half a day looking for a solution, I can't seem to resolve this issue. Any help would be greatly appreciated!
Below is the error message:
> "XHR error: (404 Not Found) loading http://olweb/node_modules/@angular/core/bundles/core.umd.js
Instantiating http://olweb/node_modules/@angular/core/bundles/core.umd.js
Loading http://olweb/node_modules/@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js
Loading http://olweb/application/main.js
Loading application/main.js"
This is the content of index.html:
<script src="~/scripts/angular2-dev.min.js?version=@version"></script>
<!-- 2. Configure SystemJS -->
<script src="~/systemjs.config.js"></script>
<script>
System.import('application/main.js').catch(function (err) { console.error(err); });
</script>
Here's a snippet from my gulp task:
// Your gulp task details here...
Finally, my system.config.js file looks like this:
(function (global) {
System.config({
warnings: true,
paths: {
'npm:': 'node_modules/'
},
// More configuration settings go here...
});})(this);