Relative url() paths in styles are resolved incorrectly for non-root directory #20360
Closed
2 of 15 tasks
Labels
area: @angular-devkit/build-angular
devkit/build-angular:browser
devkit/build-angular:karma
freq1: low
Only reported by a handful of users who observe it rarely
severity1: confusing
type: bug/fix
Milestone
🐞 Bug report
Command (mark with an
x
)Is this a regression?
I'm not sure.
Description
It looks like the assets resolution mechanism (with or without
resourcesOutputPath
) always expects that stylesheets are placed in the root folder. If you use elaborate stylesheets configuration with subfolders it brokes relative URLs in stylesheets.🔬 Minimal Reproduction
I have 2 stylesheets
styles.scss
andstyles2.scss
, configured next way inangular.json
both files have the same rule (just for testing)
after build or serve I have the next output
but relative paths in both cases resolved as for a file located in the root, i.e.
background: url(background.png);
Expected behavior
The relative path in
styles2
should be resolved as../background.png
🌍 Your Environment
The text was updated successfully, but these errors were encountered: