79480533

Date: 2025-03-03 08:56:26
Score: 1
Natty:
Report link

I was able to fix my issue. I needed to run the following steps:

  1. In my src/assets/styles/fonts.scss file, I first corrected the broken url to match to a font file.
  2. Then, I changed it to not start with ../ as it was the source of my issue.
  3. I updated the ng-package assets to create an output folder with all the fonts I needed to use.

Please find below the new versions of both files:

src/assets/styles/fonts.scss:

@font-face {
  font-family: "Roboto";
  src: url("/fonts/Roboto-Regular.woff2");
}

$base: "Roboto";

ng-package.json:

{
  "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
  "dest": "../../dist/fonts-assets-scss",
  "lib": {
    "entryFile": "src/public-api.ts"
  },
  "assets": [
    {"input": "src/assets/fonts", "glob": "**/*.woff2", "output": "fonts" }
  ]
}

Please find the corrected code on this branch

Reasons:
  • Blacklisted phrase (0.5): I need
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Corentin THIBAUD