-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Closed as not planned
Closed as not planned
Copy link
Description
Which @angular/* package(s) are the source of the bug?
Don't known / other
Is this a regression?
Yes
Description
We should be able to reference static files from architect.build.options.assets.input
in SCSS without relative paths.
Default config...
// angular.json
"projects": {
"my-app": {
"architect": {
"build": {
"options": {
"assets": [
{
"glob": "**/*",
"input": "public"
}
]
Static files in the public
directory can be referenced anywhere in the app without a relative path. For example, this does render without issue...
// app.component.html
<img src="background.jpg" />
Errors are thrown when the same static files are referenced from SCSS...
// styles.scss
html {
background-image: url("background.jpg");
}
Please provide a link to a minimal reproduction of the bug
https://github.com/david-kirkland/ng-bug-public-scss/
Please provide the exception or error you saw
X [ERROR] Could not resolve "background.jpg" [plugin angular-css-resource]
src/styles.scss:3:24:
3 │ background-image: url("background.jpg");
╵ ~~~~~~~~~~~~~~~~
You can mark the path "background.jpg" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.
Preprocessor stylesheets may not show the exact file location of the error.
Please provide the environment you discovered this bug in (run ng version
)
Angular CLI: 18.1.0
Node: 22.4.1
Package Manager: npm 10.8.1
OS: Windows 10 Enterprise
Anything else?
No response
Metadata
Metadata
Assignees
Labels
No labels