I want multiple themes for my vendors. I created multiple environments to achieve this.
However, this is the **error **i want to resolve:
enter image description here
package.json:
"scripts": {
"ng": "ng",
"main": "ng serve --proxy-config proxy.conf.js",
"theme1": "ng serve --configuration=theme1 --proxy-config proxy.conf.js",
"theme2": "ng serve --configuration=theme2 --proxy-config proxy.conf.js"
},
angular.json:
"configurations": {
"production": {
"budgets": [],
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"outputHashing": "all"
},
"theme1": {
"budgets": [],
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.theme1.ts"
}
],
"outputHashing": "all"
},
"development": {}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": { "browserTarget": "smart-journal:build:production" },
"theme1": { "browserTarget": "smart-journal:build:theme1" },
"development": { "browserTarget": "smart-journal:build:development" }
},
"defaultConfiguration": "development"
},
environments/environment.theme1.ts:
export const environment = {
production: true,
style: "theme1-styles.css",
logo: "theme1-logo.png"
};
When i start my app with
“npm run theme1”
or
“npm run theme2”
I want them to run as production and not print the production server error
How can I get my custom configuration environment themes to run as production?
running “npm run main” runs correctly and as production