Skip to content

With modified deploy-url, inlining critical css not working for downloaded roboto font #22208

@school-coder

Description

@school-coder

🐞 With modified deploy-url, inlining critical css not working for downloaded roboto font

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

No.

In v12 also, was not working.

Description

A clear and concise description of the problem...

🔬 Minimal Reproduction

With modified deploy-url, inlining critical css not working for downloaded roboto font

package.json

"scripts": {
    ...
    "build": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --base-href=/portal/ --deploy-url=/portal/public/ --configuration production"
    ...
}

font.css

@font-face {
  font-family: 'Roboto';
  src: url('Roboto-Light.woff2') format('woff2'),
  url('Roboto-Light.woff') format('woff');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

angular.json
projects..architect.build:

...
"styles": [
             ...
              "src/assets/fonts/font.css",
             ...
],
...
"configurations": {
    "production": {
        ....
        "optimization": {
                        "scripts": true,
                        "styles": {
                          "minify": true,
                          "inlineCritical": true
                        }
                      }
        ....
    }
...
}

🔥 Exception or Error

image

the path is http://localhost:8080/portal/Roboto-Light.86fc2559ff73eac5.woff2 instead of http://localhost:8080/portal/public/Roboto-Light.86fc2559ff73eac5.woff2

🌍 Your Environment

13.0.0

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions