Cannot GET with Angular 2 CLI build

697 views Asked by At

After building a project with Angular CLI, I keep getting 404:Cannot GET with my inline, styles bundle.js, and main bundle.js.

At the bottom of my index.html:

<script type="text/javascript" src="inline.js"></script>
<script type="text/javascript" src="styles.bundle.js"></script>
<script type="text/javascript" src="main.bundle.js"></script>

The files are in the same folder as index.html, with all of the angular 2 goodies. When I copy the text into the corresponding script tags, it works just fine.

1

There are 1 answers

1
dooblr On BEST ANSWER

Thanks @Johan Blomgren for the answer. Adding this fixed it:

<base href="index.html">