9

I've been using bower for a while combined with wiredep but I want to switch to using the System.js loader. For this, JSPM is ideal. However, one of the things the combination of bower and wiredep was doing for me was also including the (S)CSS.

Does JSPM deal with these files at all? Or is there a different approach that I should take to also deal with those files?

2 Answers 2

12

jspm install css

there is a plugin for this :)

for more infomation: https://github.com/systemjs/plugin-css


update: also, as @Ron said:

use it as <script>System.import('packageName/package.css!')</script>

2
  • 11
    Then use it as: <script>System.import('packageName/package.css!')</script>
    – Ron
    Aug 31, 2015 at 3:05
  • 1
    @Ron They really need to add that to their docs. Thanks for posting!
    – aendra
    Sep 3, 2016 at 1:53
0

If you are using jspm it's convenient to add this settings to jspm related config.js file

System.config({
  meta: {
    '*.css': { loader: 'css' }
  },
...
}

so you don't need to add a suffix !css each time you import css file

1
  • i add this config but i still need to add '!' to import css file
    – javad bat
    Jul 22, 2019 at 11:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.