I am developing a web application in Angular (version 2+). This application must work in two environments: test and production. I need to use an external script. When imported this way, everything works:
File angular.json:
"scripts": [
"src/assets/my_folder/dev/my_script.js"
]
In my_folder are the dev and prod folders. The application works perfectly in the Development environment, but I have no idea how to do a "dynamic variation" of this path with the path "src/assets/my_folder/prod/my_script.js" when the application is actually deployed in the production environment.
Is there some sort of "best practice" in Angular for doing this thing?