You shouldn't, and I think I can't, use ng serveto publish your assembly. Files created with help ng buildcan be uploaded to the web server and sent from there.
- Run
ng build -e=prod --prod --no-sourcemap --aot
Despite the fact that the latest version angular-clidoes not contain any source copies by default, it is worth noting here. The -e=prodcheck that he uses the work environment within a certain folder environments. The last thing is --aot. If you don’t have any special things going on inside your project, there is a big chance that you can precompile it using a compiler ahead of time. However, you may run into problems, and you can fix them with ng serve --aotor remove them altogether --aot.
dist -. , , index.html, URL-, , .
, index.html, , nginx, :
location / {
try_files $uri $uri/ /index.html;
}
, www.example.com index.html, dist. - , , www.example.com/subfolder, <base> index.html, .
, lite-server.
npm install -g lite-server
path/to/project/root/dist lite-server. - index.html
nginx .gz, nginx gzip:
gzip on;
gzip_static on;