"optimization": true breaks markup in angular

Discussão em 'Angular' iniciado por Sunstrike527, Janeiro 5, 2025.

  1. Sunstrike527

    Sunstrike527 Guest

    I have issue when I set "optimization": true on "qa" and "produciton" environemnts. When application is builded my markups is broken as it doesnt see styles.scss file at all. I can see it in browser source tab and all my classes inside but for some reason they are not applied when "optimization": true
    "optimization": false, removes an issue but I wanted to know why true affects on that. here is my angular.json

    {
    "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
    "version": 1,
    "newProjectRoot": "projects",
    "projects": {
    "my-app": {
    "projectType": "application",
    "schematics": {
    "@schematics/angular:component": {
    "style": "scss"
    }
    },
    "root": "",
    "sourceRoot": "src",
    "prefix": "app",
    "architect": {
    "build": {
    "builder": "@angular-devkit/build-angular:application",
    "options": {
    "outputPath": {
    "base": "dist",
    "browser": ""
    },
    "index": "src/index.html",
    "browser": "src/main.ts",
    "polyfills": ["zone.js"],
    "tsConfig": "tsconfig.app.json",
    "inlineStyleLanguage": "scss",
    "stylePreprocessorOptions": {
    "includePaths": ["src/styles/lib", "src/styles/core/env", "src/styles"]
    },
    "assets": ["src/favicon.ico", "src/assets", "src/web.config"],
    "styles": [
    "src/styles/styles.scss",
    "@angular/material/prebuilt-themes/indigo-pink.css"
    ],
    "scripts": [],
    "allowedCommonJsDependencies": [
    "highcharts/highcharts-more",
    "highcharts/highstock",
    "highcharts/modules/data",
    "highcharts/modules/exporting",
    "highcharts/modules/windbarb"
    ]
    },
    "configurations": {
    "qa": {
    "outputHashing": "bundles",
    "optimization": true,
    "sourceMap": false,
    "namedChunks": false,
    "extractLicenses": true,
    "fileReplacements": [
    {
    "replace": "src/environments/environment.ts",
    "with": "src/environments/environment.qa.ts"
    }
    ]
    },

    Continue reading...

Compartilhe esta Página