You can create another HTML file (or use an existing server index file) and point the script tags to the generated js files. For instance..
<!doctype html> <html> <head> <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" /> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width" /> <base href="/"> </head> <body> <my-app></my-app> <script src="http://localhost:4200/inline.js"></script> <script src="http://localhost:4200/scripts.bundle.js"></script> <script src="http://localhost:4200/main.bundle.js"></script> </body> </html>
It works for development. And for production, they include script files from the dist directory after running ng build -prod .
source share