Search code examples
angular-materialjspmsystemjs

How to disable CSS imports in JSPM / SystemJS


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.


Solution

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