如何在 JSPM/SystemJS 中禁用 CSS 导入 [英] How to disable CSS imports in JSPM / SystemJS
问题描述
我的问题是 JSPM/SystemJS 手动插入 CSS 依赖项(即 Angular Material 的 CSS),当我有不同的管道(Gulp + SASS)时.
My issue is JSPM / SystemJS manually inserting CSS dependencies (namely Angular Material's CSS) when I have a different pipeline for those (Gulp + SASS).
如何告诉 JSPM 不以任何方式导入 CSS 文件或解释 CSS 依赖项?我只找到了这个讨论 - https://github.com/jspm/jspm-cli/issues/791 - 但它根本没有帮助我.
How can I tell JSPM to not import CSS files or interpret CSS dependencies in any way? I found only this discussion - https://github.com/jspm/jspm-cli/issues/791 - but it did not help me at all.
推荐答案
似乎 JSPM 更喜欢本地包覆盖,而不是完全关闭 CSS 功能.
Seems that JSPM prefers local package overrides rather than turning off CSS features completely.
我最初问题的罪魁祸首是 Angular Material 的 包.json
,其中包含以下JSPM配置:
The culprit of my original issue is Angular Material's package.json
, which contains the following JSPM configuration:
"shim": {
"angular-material": {
"deps": [ "./angular-material.css!" ]
}
}
所以真正解决我的问题的是覆盖该配置:
So what really solved my issue was to override that configuration:
jspm install angular-material -o '{ shim: {} }'
这篇关于如何在 JSPM/SystemJS 中禁用 CSS 导入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!