You are developing an ADF app but you notice that you need a different configuration for different environments.
You have many environments including development, master, production but they all depend on your app.config.json. Each time you switch environment may you have to change or copy a different app.config.json.
Why do you need to do that? The problem is that ADF requires that the name of your configuration file has always to be app.config.json.
Yes is my problem!!! how to make it works in multiple environments?
"apps": [
{
"name": "dist",
"root": "src",
"outDir": "dist",
"assets": [
....
{
"glob": "app.config_dist.json",
"input": "../src/",
"output": "app.config.json"
},
....
}
{
"name": "dev",
"root": "src",
"outDir": "dist",
"assets": [
....
{
"glob": "app.config_dev.json",
"input": "../src/",
"output": "app.config.json"
},
....
}
Notice that in the assets array is already present an app.config.json reference you should remove it. I used this conf on my machine it works
"scripts": {
"ng": "ng",
"start": "ng serve --open --app dist",
"start:dev": "ng serve --open --app dev",
"build": "ng build --app dist",
"build:dev": "ng build --app dev",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
}
After this change what you need to do is run the command:
You can find more documentation about how to set up the angular cli here: https://github.com/angular/angular-cli/wiki