SCSS在angular-cli中加载错误

时间:2017-06-01 10:03:53

标签: angular angular-cli

我使用AngularCLI到Angular2。我包含了带SCSS语法的sass预处理器。但是当我输入服务或npm运行构建后弹出我得到这样的东西。我检查了目录,一切都很好,我读到了关于SASS加载程序错误,但现在我有最新版本,修复了该错误。有谁知道如何解决它?

提前谢谢你。

ERROR in ./~/css-loader?{"sourceMap":false,"importLoaders":1}!./~/postcss-
loader?{"ident":"postcss"}!./~/sass-loader/lib/loader.js?
{"sourceMap":false,"precision":8,"includePaths":[]}!./src/styles.scss 
Module not found: Error: Can't resolve '../images/arrow_bullet-01.png' in 
'F:\Angular2Tests\bootstrapscss\src'
@ ./~/css-loader?{"sourceMap":false,"importLoaders":1}!./~/postcss-loader?
{"ident":"postcss"}!./~/sass-loader/lib/loader.js?
{"sourceMap":false,"precision":8,"includePaths":[]}!./src/styles.scss  
6:87042-87082
@ ./src/styles.scss
@ multi ./src/styles.scss

ERROR in ./~/css-loader?{"sourceMap":false,"importLoaders":1}!./~/postcss-
loader?{"ident":"postcss"}!./~/sass-loader/lib/loader.js?
{"sourceMap":false,"precision":8,"includePaths":[]}!./src/styles.scss
Module not found: Error: Can't resolve '../fonts/glyphicons-halflings-
regular.eot' in 'F:\Angular2Tests\bootstrapscss\src'
@ ./~/css-loader?{"sourceMap":false,"importLoaders":1}!./~/postcss-loader?
{"ident":"postcss"}!./~/sass-loader/lib/loader.js?
{"sourceMap":false,"precision":8,"includePaths":[]}!./src/styles.scss 
6:243131-243183 6:243206-243258
@ ./src/styles.scss
@ multi ./src/styles.scss

ERROR in ./~/css-loader?{"sourceMap":false,"importLoaders":1}!./~/postcss-
loader?{"ident":"postcss"}!./~/sass-loader/lib/loader.js?
{"sourceMap":false,"precision":8,"includePaths":[]}!./src/styles.scss
Module not found: Error: Can't resolve '../fonts/glyphicons-halflings-
regular.woff' in 'F:\Angular2Tests\bootstrapscss\src'
@ ./~/css-loader?{"sourceMap":false,"importLoaders":1}!./~/postcss-loader?
{"ident":"postcss"}!./~/sass-loader/lib/loader.js?
{"sourceMap":false,"precision":8,"includePaths":[]}!./src/styles.scss 
6:243310-243363
@ ./src/styles.scss
@ multi ./src/styles.scss

1 个答案:

答案 0 :(得分:1)

sass库存在一个已知问题,即它无法加载与其导入文件相关的文件。对于字体,可能需要使用绝对路径导入src目录。

跟踪问题here

angular-cli小组决定关闭它,因为它是sass lib而不是cli的问题。