【发布时间】:2018-02-27 11:58:23
【问题描述】:
我正在使用 angular-cli version 1.3.2 构建一个 angular 4 应用程序,到目前为止一切顺利。我在https://github.com/angular/angular-cli/wiki/stories-global-styles 阅读了我们可以使用延迟加载的全局样式的文档。
现在当我运行命令时
ng build --prod -vc -nc --build-optimizer
它为引导生成以下输出
块 {bootstrapBundle} bootstrapBundle.cf320d25069acd157990.bundle.css (bootstrapBundle) 96.9 kB {inline} [初始]
据我了解,这个 css 应该应用于网站,但是当我看到该网站时,它没有应用任何引导 css。
现在,如何在站点中使用 bootstrapBundle 或 bootstrap 块?
这是我的 angular-cli.json 样式配置
"styles": [
"styles.scss"
{
"input": "./assets/smartadmin/bootstrap.scss",
"lazy": true,
"output":"bootstrapBundle"
},
],
请帮忙。
谢谢。
【问题讨论】:
-
看看Lazy load application theme styles with Angular CLI我认为它应该回答你的问题
-
@Kuncevic 感谢您的链接。我也以同样的方式解决了它。我会添加我的答案。
标签: angular angular-cli