magarcia / generator-angular2-webpack-starter

Yeoman generator for Angular2 Webpack Starter based on https://angularclass.github.io/angular2-webpack-starter/
MIT License
26 stars 4 forks source link

A browser can't access files in the assets folder in development mode, but does so in a production build. #4

Open jared83 opened 8 years ago

jared83 commented 8 years ago

Below is my app.html template, where the /assets/img/header/logo.png doesn't display in any and all browsers while developing (with live reload), but it displays fine once I do npm run build:prod and then npm run server:prod. Note that I have not made any configuration changes to webpack.config.js or tsconfig.json.

<header class="side">
    <img class="ms-logo" src="/assets/img/header/logo.png" alt="Logo">
    <nav>
    <ul>
        <li router-active="active">
        <a [routerLink]=" ['Home'] ">Home</a>
        </li>
        <li router-active="active">
        <a [routerLink]=" ['Projects'] ">Projects</a>
        </li>
        <li router-active="active">
        <a [routerLink]=" ['About'] ">About</a>
        </li>
        <li router-active="active">
        <a [routerLink]=" ['Contact'] ">Contact</a>
        </li>
    </ul>
    </nav>
</header>

<main>
    <router-outlet></router-outlet>
</main>

<footer class="side">
    marcossebastian by <a href="mailto:xxx@mail.com" target="_top">Jared</a>
</footer>

<div id="BackgroundText">
    simplicity
</div>

Is this the expected behavior? Should I make some changes in any of the configuration files?