Вы можете настроить разные css файлы для каждой среды. Посмотри мои файлы
angular. json:
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"neo-assets-ngcli": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "build",
"index": "src/index.html",
"main": "src/main.ts",
"tsConfig": "src/tsconfig.app.json",
"namedChunks": true,
"polyfills": "src/polyfills.ts",
"assets": [
"src/assets/fonts",
"src/assets/js/settings.js",
"src/assets/img",
"src/assets/.htaccess",
"src/assets/index.tpl",
"src/favicon.ico",
"src/assets/csv",
{
"glob": "**/*",
"input": "./node_modules/leaflet/dist/images",
"output": "assets/"
}
],
"stylePreprocessorOptions": {
"includePaths": [
"src/environments/scss-dev"
]
}
},
"configurations": {
"production": {
"optimization": true,
"outputHashing": "all",
"sourceMap": {
"hidden": false,
"scripts": true,
"styles": true
},
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"stylePreprocessorOptions": {
"includePaths": [
"src/environments/scss-prod"
]
}
}
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"karmaConfig": "./karma.conf.js",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"stylePreprocessorOptions": {
"includePaths": [
"src/environments/scss-dev"
]
}
},
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"neo-assets-ngcli-e2e": {
"root": "e2e",
"sourceRoot": "e2e",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "./protractor.conf.js",
"devServerTarget": "neo-assets-ngcli:serve"
},
"configurations": {
"noserve": {
"devServerTarget": ""
}
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"e2e/tsconfig.e2e.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "neo-assets-ngcli",
"schematics": {
"@schematics/angular:component": {
"prefix": "",
"styleext": "scss"
},
"@schematics/angular:directive": {
"prefix": ""
}
}
}
Посмотри атрибут includePaths в каждой среде.
Тогда у меня есть файл globalVars.s css в каждой папке. Каждый со своим путем.
И, наконец, в стилях.s css первая строка:
@ import "globalVars";