我有一个名为"styles.scss"的文件,以这种方式编写,在Angular 7版本中正常工作:
/* You can add global styles to this file, and also import other style files */
@import "~ng-pick-datetime/assets/style/picker.min.css";
@import "~materialize-css/sass/components/_color.scss";
@import './colors';
$roboto-font-path: "~materialize-css/dist/fonts/roboto/";
@import "~materialize-css/sass/materialize";
/* isso aqui serve para o datepicker funcionar com modal do materialize ou mesmo bootstrap*/
.cdk-overlay-container {
position: fixed;
z-index: 1090;
}
更新到版本8后,Angular找不到正确的路径,我收到以下错误信息:
ERROR in ./src/styles.scss (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/sass-loader/lib/loader.js??ref--13-3!./src/styles.scss)
Module build failed (from ./node_modules/sass-loader/lib/loader.js):
@import "~materialize-css/sass/components/_color.scss";
^
Can't find stylesheet to import.
╷
4 │ @import "~materialize-css/sass/components/_color.scss";
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
╵
stdin 4:10 root stylesheet
in D:\angular_projects\inteligencia-web\src\styles.scss (line 4, column 10)
我发现 Angular 不理解指向 node_modules 文件夹的这个路径。我需要做出什么改变?