if (typeof window !== 'undefined') {
  var waitSeconds = 100;

  var head = document.getElementsByTagName('head')[0];

  // get all link tags in the page
  var links = document.getElementsByTagName('link');
  var linkHrefs = [];
  for (var i = 0; i < links.length; i++) {
    linkHrefs.push(links[i].href);
  }

  var isWebkit = !!window.navigator.userAgent.match(/AppleWebKit\/([^ ;]*)/);
  var webkitLoadCheck = function(link, callback) {
    setTimeout(function() {
      for (var i = 0; i < document.styleSheets.length; i++) {
        var sheet = document.styleSheets[i];
        if (sheet.href == link.href)
          return callback();
      }
      webkitLoadCheck(link, callback);
    }, 10);
  };

  var noop = function() {};

  var loadCSS = function(url) {
    return new Promise(function(resolve, reject) {
      var timeout = setTimeout(function() {
        reject('Unable to load CSS');
      }, waitSeconds * 1000);
      var _callback = function(error) {
        clearTimeout(timeout);
        link.onload = link.onerror = noop;
        setTimeout(function() {
          if (error)
            reject(error);
          else
            resolve('');
        }, 7);
      };
      var link = document.createElement('link');
      link.type = 'text/css';
      link.rel = 'stylesheet';
      link.href = url;
      if (!isWebkit) {
        link.onload = function() {
          _callback();
        }
      } else {
        webkitLoadCheck(link, _callback);
      }
      link.onerror = function(event) {
        _callback(event.error || new Error('Error loading CSS file.'));
      };
      head.appendChild(link);
    });
  };

  exports.fetch = function(load) {
    // dont reload styles loaded in the head
    for (var i = 0; i < linkHrefs.length; i++)
      if (load.address == linkHrefs[i])
        return '';
    return loadCSS(load.address);
  };
}
else {
  function getBuilder(loader) {
    return loader['import']('./css-builder' + (System.version ? '.js' : ''), { name: module.id });
  }

  exports.cssPlugin = true;
  exports.fetch = function(load) {
    // individually mark loads as not built for buildCSS false
    if (this.buildCSS === false)
      load.metadata.build = false;
    // setting format = 'defined' means we're managing our own output
    load.metadata.format = 'defined';
    // don't load the CSS at all until build time
    return '';
  };
  exports.instantiate = function() {};
  exports.bundle = function(loads, opts) {
    var loader = this;
    if (loader.buildCSS === false)
      return '';
    return getBuilder(loader).then(function(builder) {
      return builder.bundle.call(loader, loads, opts);
    });
  };
  exports.listAssets = function(loads, compileOpts, outputOpts) {
    var loader = this;
    return getBuilder(loader).then(function(builder) {
      return builder.listAssets.call(loader, loads, compileOpts, outputOpts);
    });
  };
}

@@ -116,201 +116,8 @@
 %5D;%0A%0A
-  // get all link tags in the page%0A  var links = document.getElementsByTagName('link');%0A  var linkHrefs = %5B%5D;%0A  for (var i = 0; i %3C links.length; i++) %7B%0A    linkHrefs.push(links%5Bi%5D.href);%0A  %7D%0A%0A
   va
@@ -503,24 +503,656 @@
  10);%0A  %7D;%0A%0A
+  var cssIsReloadable = function cssIsReloadable(links)%7B%0A    // Css loaded on the page initially should be skipped by the first%0A    // systemjs load, and marked for reload%0A    var reloadable = true;%0A    forEach(links, function(link)%7B%0A      if(!link.hasAttribute('data-systemjs-css'))%7B%0A        reloadable = false;%0A        link.setAttribute('data-systemjs-css', '');%0A      %7D%0A    %7D);%0A    return reloadable;%0A  %7D%0A%0A  var findExistingCSS = function findExistingCSS(url)%7B%0A    // Search for existing link to reload%0A    var links = head.getElementsByTagName('link')%0A    return filter(links, function(link)%7B return link.href === url; %7D);%0A  %7D%0A%0A
   var noop =
@@ -1196,16 +1196,31 @@
 tion(url
+, existingLinks
 ) %7B%0A    
@@ -1769,16 +1769,66 @@
  = url;%0A
+      link.setAttribute('data-systemjs-css', '');%0A
       if
@@ -2110,25 +2110,319 @@
 ead.
-appendChild(link)
+insertBefore(link, existingLinks%5B0%5D);%0A    %7D)%0A    .then(function(result)%7B %0A      forEach(existingLinks, function(link)%7Blink.parentElement.removeChild(link);%7D)%0A      return result;%0A    %7D)%0A    .catch(function(err)%7B%0A      forEach(existingLinks, function(link)%7Blink.parentElement.removeChild(link);%7D)%0A      throw err
 ;%0A  
@@ -2464,24 +2464,38 @@
 ion(load) %7B%0A
+    debugger;%0A
     // dont 
@@ -2535,89 +2535,73 @@
     
-for (var i = 0; i %3C linkHrefs.length; i++)%0A      if (load.address == linkHrefs%5Bi%5D
+var links = findExistingCSS(load.address)%0A    if(!cssIsReloadable
 )%0A  
@@ -2648,16 +2648,23 @@
 .address
+, links
 );%0A  %7D;%0A
@@ -3689,16 +3689,289 @@
 %0A    %7D);%0A  %7D;%0A%7D%0A
+%0A// Because IE8?%0Afunction filter(arrayLike, func)%7B%0A  var arr = %5B%5D%0A  forEach(arrayLike, function(item)%7B%0A    arr.push(item);%0A  %7D);%0A  return arr;%0A%7D%0A%0A// Because IE8?%0Afunction forEach(arrayLike, func)%7B%0A  for (var i = 0; i %3C arrayLike.length; i++) %7B%0A    func(arrayLike%5Bi%5D)%0A  %7D%0A%7D%0A

Support css hot reload