787ddf149ece73e99210c2636ff8cd6599eb51c5b68071bc23d3e5c7c29896d1ed45b6ab2bbf3455ceb3be1c2ad38dbb7524c2f0ae9b5ceee1ff1d5942bc8f 723 B

123456789101112131415161718192021222324
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. module.exports = function addStyleUrl(cssUrl) {
  6. if(typeof DEBUG !== "undefined" && DEBUG) {
  7. if(typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
  8. }
  9. var styleElement = document.createElement("link");
  10. styleElement.rel = "stylesheet";
  11. styleElement.type = "text/css";
  12. styleElement.href = cssUrl;
  13. var head = document.getElementsByTagName("head")[0];
  14. head.appendChild(styleElement);
  15. if(module.hot) {
  16. return function(cssUrl) {
  17. if(typeof cssUrl === "string") {
  18. styleElement.href = cssUrl;
  19. } else {
  20. head.removeChild(styleElement);
  21. }
  22. };
  23. }
  24. }