preboot/angular-webpack

npm run build not working

Closed this issue · 6 comments

after building and generating the dist directory, when I try to view index.html in my browser I get:

app.133a50d6c1beddd2e480.css Failed to load resource: net::ERR_FILE_NOT_FOUND
polyfills.133a50d6c1beddd2e480.js Failed to load resource: net::ERR_FILE_NOT_FOUND
vendor.133a50d6c1beddd2e480.js Failed to load resource: net::ERR_FILE_NOT_FOUND
app.133a50d6c1beddd2e480.js Failed to load resource: net::ERR_FILE_NOT_FOUND
file:///img/favicon.ico Failed to load resource: net::ERR_FILE_NOT_FOUND
screen shot 2017-01-31 at 5 29 00 pm

Can you show me the content of the index?

screen shot 2017-01-31 at 5 34 50 pm

<!DOCTYPE html>
<html>
  <head>
    <!-- Required meta tags-->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <!-- Your app title -->
    <title>BMW Angular Starter</title>    
    <base href="/">
  <link href="/css/vendor.1799d8e5ad549205798a.css" rel="stylesheet"><link href="/css/app.1799d8e5ad549205798a.css" rel="stylesheet"></head>
  <body>
    <!-- Views -->
    <div class="views">
      <!-- Your main view, should have "view-main" class -->
      <div class="view view-main">                    
        <!-- Pages container, because we use fixed-through navbar and toolbar, it has additional appropriate classes-->
        <div class="pages">
          <!-- Page, "data-page" contains page name -->
          <div data-page="index" class="page">
            <!-- Scrollable page content -->
            <div class="page-content">
              <my-app>Loading...</my-app>
            </div>
          </div>
        </div>
      </div>
    </div>
  <script type="text/javascript" src="/js/polyfills.1799d8e5ad549205798a.js"></script><script type="text/javascript" src="/js/vendor.1799d8e5ad549205798a.js"></script><script type="text/javascript" src="/js/app.1799d8e5ad549205798a.js"></script></body>
</html> 

So I guess you are trying to double click the index.html? You need a proper server.

yep I'm just double clicking. Why do I need a proper server?

By the way I just tried python -m SimpleHTTPServer and it worked fine. Just curious as to why I need to do this?

the script tags won't find the files by double clicking it, a proper server will be able to work with the base href, see the correct path and load the files. By double click, will try to find the files in the root of your drive.