Home » Uncategorized » Deploy Angular

Deploy Angular

Run ng build.
This generates a folder ‚dist‚ containing another folder named like the angular project name, containing a ‚browser‚ directory. E.G. dist/my-project/browser

The browser folders content can be put into a directory that is actually served by a HTTP server.
Meaning: E.G. if an index.html is served by a HTTP server this one can be replaced by the ‚browser‘ directory content within your ‚dist‘ folder.

When I did that, still there was a problem that the index.html of our Angular build was just displayed as a blank page. When facing this, then open the developers console of the browser and observe the errors. Probably it says something about (HTTP 404) resources not found. This can be mitigated by adapting the base ref directive in the index.html file: E.G. I have changed it to <base href=“.“>

Reading


Hinterlasse einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert