How to disable CSS imports in JSPM / SystemJS

浪子不回头ぞ 提交于 2019-12-08 08:54:32

问题


My issue is JSPM / SystemJS manually inserting CSS dependencies (namely Angular Material's CSS) when I have a different pipeline for those (Gulp + SASS).

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.


回答1:


Seems that JSPM prefers local package overrides rather than turning off CSS features completely.

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: {} }'


来源:https://stackoverflow.com/questions/32933622/how-to-disable-css-imports-in-jspm-systemjs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!