system js - css plugin

by Leo

HTML

<script src="https://rawgit.com/ModuleLoader/es6-module-loader/master/dist/es6-module-loader.src.js"></script>
<script src="//rawgit.com/systemjs/systemjs/0.19.26/dist/system.js"></script>

JavaScript

System.config({
    paths: {
        "rawgit:*" : "https://rawgit.com/*.js",
        "csssample:": "http://cdn.leafletjs.com/leaflet/v0.7.7/"
    },
    map: {
        css: "rawgit:systemjs/plugin-css/0.1.23/css"
    }
});

/**
var systemLocate = System.locate;
System.locate = function(load) {
  var System = this; // its good to ensure exact instance-binding
  return Promise.resolve(systemLocate.call(this, load)).then(function(address) {
    return address;  + System.cacheBust;
  });
}
System.cacheBust = '?bust=' + Date.now();
*/

//will result in http://time.jsontest.com/?bust=1423071361?bust=1423071361859 being requested
System.import("csssample:!css")
    .then(function(css) {
       console.log(css);
 });