I am building MVC5 application with Angular 4 and I am using Angular Cli to create angular app.
The problem I am facing I have MVC5 application running on port 5011 while angular app using angular cli using a port 4200. When I run the MVC application everything work fine except lazy loaded module.
Because lazy loaded module create chunks.js and those chunks are giving error not found. But all other js loaded successfully.
Here is the problem loading chunks.js
My MVC application use port 5011 Angular cli app use port 4200 I reference js files in my _Layout.cshtml are as follows
<script type="text/javascript" src="http://localhost:4200/inline.bundle.js"></script>
<script type="text/javascript" src="http://localhost:4200/polyfills.bundle.js"></script>
<script type="text/javascript" src="http://localhost:4200/styles.bundle.js"></script>
<script type="text/javascript" src="http://localhost:4200/vendor.bundle.js"></script>
<script type="text/javascript" src="http://localhost:4200/main.bundle.js"></script>
While chunks.js try to load from this url automatically
http://localhost:5011/0.chunk.js
Why is chunks port different than Angular cli port? how to resolve this issue?