on-internet
← Community

angular - How to dynamically change the content in the index.html file when running the ng-build command

Stack Overflow ·

I want to change the URL of a script tag when I'm running the ng build command with the --prod option and without the --prod option. Following is an example. ng build --prod <!DOCTYPE html> <html> <head> <title>Home Page</title> </head> <body> <script src="https://my-site.net/prod.js"></script> </body> </html> ng build <!DOCTYPE html> <html> <head> <title>Home Page</title> </head> <body> <script src="https://my-site.net/dev.js"></script> </body> </html> How can I achieve this?

Comments

Sign in or sign up to comment and upvote.

No comments yet.