Files
marketplaces/angular.json
sdarbinyan 70b730a6ed feat: implement scalable multi-brand architecture
Architecture:
- Each brand has its own pages folder with Angular components
- brand-routes.ts defines routes for default brand (dexar)
- brand-routes.novo.ts defines routes for novo brand
- angular.json fileReplacements swaps brand-routes.ts based on build config

Structure:
- src/app/brands/dexar/pages/ - Dexar HTML templates
- src/app/brands/novo/pages/ - Novo components (TS + HTML)
- src/app/brands/brand-routes.ts - Default (dexar) routes
- src/app/brands/brand-routes.novo.ts - Novo routes

This approach allows:
- Adding 3rd, 4th, 5th brands by creating new folders
- Each brand has completely separate templates
- No @if conditionals needed in templates
- Build-time separation (zero runtime overhead)
2026-01-23 00:00:08 +04:00

202 lines
5.9 KiB
JSON

{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"Dexarmarket": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss"
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular/build:application",
"options": {
"outputPath": "dist/dexarmarket",
"browser": "src/main.ts",
"polyfills": [
"zone.js"
],
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
{
"glob": "**/*",
"input": "public"
}
],
"styles": [
"src/styles.scss"
]
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.production.ts"
}
],
"styles": [
"src/styles.scss",
"src/styles/themes/dexar.theme.scss"
],
"budgets": [
{
"type": "initial",
"maximumWarning": "500kB",
"maximumError": "1MB"
},
{
"type": "anyComponentStyle",
"maximumWarning": "25kB",
"maximumError": "35kB"
}
],
"outputHashing": "all",
"optimization": {
"scripts": true,
"styles": {
"minify": true,
"inlineCritical": true
},
"fonts": {
"inline": true
}
},
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true,
"serviceWorker": "ngsw-config.json"
},
"development": {
"styles": [
"src/styles.scss",
"src/styles/themes/dexar.theme.scss"
],
"optimization": false,
"extractLicenses": false,
"sourceMap": true
},
"novo": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.novo.ts"
},
{
"replace": "src/app/brands/brand-routes.ts",
"with": "src/app/brands/brand-routes.novo.ts"
}
],
"index": "src/index.novo.html",
"styles": [
"src/styles.scss",
"src/styles/themes/novo.theme.scss"
],
"outputPath": "dist/novomarket",
"optimization": false,
"extractLicenses": false,
"sourceMap": true
},
"novo-production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.novo.production.ts"
},
{
"replace": "src/app/brands/brand-routes.ts",
"with": "src/app/brands/brand-routes.novo.ts"
}
],
"index": "src/index.novo.html",
"styles": [
"src/styles.scss",
"src/styles/themes/novo.theme.scss"
],
"outputPath": "dist/novomarket",
"budgets": [
{
"type": "initial",
"maximumWarning": "500kB",
"maximumError": "1MB"
},
{
"type": "anyComponentStyle",
"maximumWarning": "25kB",
"maximumError": "35kB"
}
],
"outputHashing": "all",
"optimization": {
"scripts": true,
"styles": {
"minify": true,
"inlineCritical": true
},
"fonts": {
"inline": true
}
},
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"options": {
"allowedHosts": ["novo.market", "dexarmarket.ru", "localhost"]
},
"builder": "@angular/build:dev-server",
"configurations": {
"production": {
"buildTarget": "Dexarmarket:build:production"
},
"development": {
"buildTarget": "Dexarmarket:build:development"
},
"novo": {
"buildTarget": "Dexarmarket:build:novo"
},
"novo-production": {
"buildTarget": "Dexarmarket:build:novo-production"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular/build:extract-i18n"
},
"test": {
"builder": "@angular/build:karma",
"options": {
"polyfills": [
"zone.js",
"zone.js/testing"
],
"tsConfig": "tsconfig.spec.json",
"inlineStyleLanguage": "scss",
"assets": [
{
"glob": "**/*",
"input": "public"
}
],
"styles": [
"src/styles.scss"
]
}
}
}
}
}
}