Answer the question
In order to leave comments, you need to log in
How to run a compiled Angular2+ application and why does it need a server?
I made a small application on Angular 6.
As I understand it, the whole thing is eventually compiled and assembled into a set of html, css, js and binary files. I googled that there are commands for the Angular CLI that do this, ng bild
and ng bild --prod
other variations with arguments. First I did the first one, after some time after the experiments - the other one, the dist folder appeared in the root of the project and in it a set of ordinary html, css, js files, etc.
I ran index.html and saw a blank sheet, and an error in Dev Tools
ERROR Error: Uncaught (in promise): SecurityError: Failed to execute 'replaceState' on 'History': A history state object with URL 'file:///E:/' cannot be created in a document with origin 'null' and URL
Answer the question
In order to leave comments, you need to log in
1. https://angular.io/guide/deployment#basic-deployme...
2. Not needed if you have production mode without SSR.
3. Build the application in production mode without SSR.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question