v18.0.1 Invalid URL replacement in SCSS @function #27734
Labels
angular/build:application
area: @angular/build
freq1: low
Only reported by a handful of users who observe it rarely
severity5: regression
type: bug/fix
Command
build
Is this a regression?
The previous version in which this bug was not present was
17.3.8
Description
The SCSS preprocessor matches
url(
in@function
definitions, which causes SCSS compilation to fail.e.g.
is rewritten as
Which then fails with:
Similar to this recent issue, where the pre-processor is replacing URLs in a way that is not compatible with an external library
#27688
I think the problem lies with the lexer which may need to explicitly ignore
@function
callshttps://github.com/angular/angular-cli/blob/18.0.x/packages/angular/build/src/tools/sass/lexer.ts#L51C11-L51C14
Minimal Reproduction
npx @angular/[email protected] new --defaults --style scss scss-url-bug18
cd scss-url-bug18
npm i govuk-frontend
echo "@import 'govuk-frontend/dist/govuk/all';" > src/styles.scss
ng build
Exception or Error
Your Environment
Anything else relevant?
No response
The text was updated successfully, but these errors were encountered: