systemjs / plugin-css

CSS loader plugin
MIT License
92 stars 60 forks source link

Basic usage #56

Closed richburdon closed 9 years ago

richburdon commented 9 years ago

Since the "docs" are pretty light, are there any examples of how to use systemjs with css? E.g., supposing I need to load the main Bootstrap CSS (installed via JSPM): should I Use System.import in the root script of the page, or use "import" in one of the modules?

If I try the following:

  System.import('bootstrap/css/bootstrap.css!');

Then I get a 404:

GET http://127.0.0.1:5000/res/css.js 404 (NOT FOUND)M 
Uncaught (in promise) Error: XHR error (404 NOT FOUND) loading    
http://127.0.0.1:5000/res/css.js
Error loading http://127.0.0.1:5000/res/css.js
Error loading 
http://127.0.0.1:5000/res/packages/github/twbs/bootstrap@3.3.5/css/bootstrap.css!http://127.0.0.1:5000/res/css.js
at r (http://127.0.0.1:5000/res/packages/system.js:4:10674)
at XMLHttpRequest.o.onreadystatechange (http://127.0.0.1:5000/res/packages/system.js:4:11228)
richburdon commented 9 years ago

These things are obvious once you know the answer. But it's really hard to get started.

ANSWER: "jspm install css"