我正在尝试在CSS文件中导入SCSS文件。当我尝试编译项目时出现以下错误。有人面对过这个问题吗?我看过互联网,但错误解释不清楚。谢谢!
ERROR in ./src/styles.css (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./src/styles.css)
Module build failed (from ./node_modules/postcss-loader/src/index.js):
Error: ENOENT: no such file or directory, open '\src\theme.scss'
styles.css
@import "/src/theme.scss";
答案 0 :(得分:1)
您还可以像这样将其添加到angular.json文件中:
styles: [
"src/theme.scss"
]
,它应该捡起来。