代码>Under projects -> library_name -> architect -> build -> options但这在构建库项目时显示错误but this is showing error while building the library projectSchema validation failed with the following errors: Data path "" should NOT have additional properties(styles). 更新我得到了这,如果有帮助的话,也解决了同样的问题!/p>I got this, addressing the same issue if it helps!推荐答案直到该日期(2019年1月10日),尽管这是一种非常常见的情况,但库中没有对全局scss的直接支持.Till the date (10-Jan-2019, there is no direct support for global scss in the library even though this is a very common scenario.通过讨论,我得到了需要捆绑的解决方法我自己.所以我用 scss-bundle 创建了一个大的scss文件.您可以使用From this discussion, I got the workaround that I need to bundle it myself. So I used scss-bundle to create one big scss file. You can add it usingyarn add scss-bundle@next -D然后绑定脚本并在监视模式下运行and then the script to bundle and run in watch mode"build-lib-watch-styles": "scss-bundle -e \"./projects/lib-name/src/lib/styles/lib-name.scss\" -d \"./dist-lib/lib-name/styles/lib-name.scss\" -w \"./projects/lib-name/src/lib/styles\"", 这篇关于将SCSS与使用angular-cli创建的角度库一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-14 07:06