system js - css plugin
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:*" : "//rawgit.com/*.js",
"csssample:": "//cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css",
"leaflet": "//cdn.leafletjs.com/leaflet/v0.7.7/leaflet.js"
},
map: {
css: "rawgit:systemjs/plugin-css/0.1.23/css"
}
});
//will result in http://time.jsontest.com/?bust=1423071361?bust=1423071361859 being requested
Promise.all([
System.import("leaflet").then(function() {console.log("leaflet js loaded");}),
System.import("csssample:!css").then(function() {console.log("leaflet css loaded");})
]).then(function(){
debugger;
});