我正在库中使用.scss,我已经在angular.json中设置了选项,
"stylePreprocessorOptions": {
"includePaths": ["projects/magic-string-example/src/app/styles", "node_modules/"]
}在库组件中,使用如下所示
@import '_variables';这在ng-serve期间是有效的,但是当我尝试构建lib时,我得到了错误:
ERROR: Can't find stylesheet to import.
@import '_variables';我试着在网上搜索,但还是找到了解决方案,需要一些帮助。
谢谢
发布于 2021-06-24 06:23:04
通过使用以下命令更新项目/项目名称/architect/ angular.json和项目/项目名称/architect/build中的角度文件,在stylePreprocessorOptions-property中添加文件:
"options": {
"styles": ["src/styles.scss"],
"stylePreprocessorOptions": {
"includePaths": ["src/assets/styles"]
}
}https://stackoverflow.com/questions/68103563
复制相似问题