【问题标题】:Lazy loading styles in AngularAngular 中的延迟加载样式
【发布时间】:2019-07-25 08:14:44
【问题描述】:

我正在尝试在 css 中编译 print-styles.scss 并通过 Angular 编译器放入 assets 文件夹。

我需要它来将样式注入应该打印一些内容的 iframe。

问题在于 angular.json 中

styles: [{
   "input": "projects/public/src/print-styles.scss",
   "lazy": true,
   "bundleName": "print-styles-hello"
}]

导致我不知道如何使用的 JS 文件。

我不想使用任何 Gulp 或其他附加工具。

【问题讨论】:

标签: css angular


【解决方案1】:

通过指定"extractCss": true 来解决,这会导致预期的.css 输出常量。

【讨论】:

    猜你喜欢
    • 2022-10-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-01-29
    • 2019-11-04
    • 2022-07-08
    • 2018-02-19
    • 2017-02-22
    相关资源
    最近更新 更多