I'm working on an Angular 2
front-end on an ASP.NET 4.5
backend project. On this project I've configured a sort of wwwroot
(thanks to this tutorial) pointing to my dist
folder.
But since it's an Angular 2
project, I'm also redirecting everything to index.html
page
<rule name="AngularJS" stopProcessing="true">
<match url="[a-zA-Z]*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
<add input="{REQUEST_URI}" pattern="^/oauth" negate="true" />
</conditions>
<action type="Rewrite" url="/" />
</rule>
Now my problem is that since I added the PhysicalFileSystem, I can't retrieve my bundle file anymore. I'm requesting main.bundle.js
(which is located in dist/main.bundle.js
), which should be rightly retrieved thanks to the filesystem, but unlucky for me, it's catch by the RewriteRule and it just render me the index.html page.
How can I fix the priority of this?
TL;DR Redirecting everything to index.html, but also have a logical root folder under dist. Would like my server to retrieve everything from dist, but it fall under the RewriteRule since it's not physically present.