Open
Description
Command
serve
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
17.3.4
Description
I'm encountering an issue where ng serve fails to build and serve my Angular application when I use the @import directive in the index.html file. This behavior is unexpected as the @import rule is a standard CSS mechanism.
Minimal Reproduction
- Create a new project with
ng new
(using Sass (SCSS)) - Add the following piece of code to the
head
tag in theindex.html
file
<style>
@import url('./styles.css');
</style>
- Run
ng serve
Exception or Error
Unable to resolve `@import "./styles.css"` from `my-path`
[vite] Internal server error: [postcss] ENOENT: no such file or directory, open './styles.css'
Plugin: vite:css
File: /index.html?html-proxy&direct&index=0.css:undefined:NaN
Your Environment
Angular CLI: 18.1.3
Node: 20.11.1
Package Manager: npm 10.2.4
OS: darwin arm64
Angular:
...
Package Version
------------------------------------------------------
@angular-devkit/architect 0.1801.3 (cli-only)
@angular-devkit/core 18.1.3 (cli-only)
@angular-devkit/schematics 18.1.3 (cli-only)
@schematics/angular 18.1.3 (cli-only)
Anything else relevant?
No response