diff --git a/addStyleUrl.js b/addStyleUrl.js deleted file mode 100644 index cfed6364..00000000 --- a/addStyleUrl.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ - -function attachTagAttrs(element, attrs) { - Object.keys(attrs).forEach(function (key) { - element.setAttribute(key, attrs[key]); - }); -} - -module.exports = function addStyleUrl(cssUrl, options) { - if(typeof DEBUG !== "undefined" && DEBUG) { - if(typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment"); - } - - options = options || {}; - options.attrs = typeof options.attrs === "object" ? options.attrs : {}; - - var styleElement = document.createElement("link"); - styleElement.rel = "stylesheet"; - styleElement.type = "text/css"; - styleElement.href = cssUrl; - - attachTagAttrs(styleElement, options.attrs); - - var head = document.getElementsByTagName("head")[0]; - head.appendChild(styleElement); - if(module.hot) { - return function(cssUrl) { - if(typeof cssUrl === "string") { - styleElement.href = cssUrl; - } else { - head.removeChild(styleElement); - } - }; - } -} \ No newline at end of file diff --git a/addStyles.js b/addStyles.js deleted file mode 100644 index d1ee3a63..00000000 --- a/addStyles.js +++ /dev/null @@ -1,307 +0,0 @@ -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -var stylesInDom = {}, - memoize = function(fn) { - var memo; - return function () { - if (typeof memo === "undefined") memo = fn.apply(this, arguments); - return memo; - }; - }, - isOldIE = memoize(function() { - // Test for IE <= 9 as proposed by Browserhacks - // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805 - // Tests for existence of standard globals is to allow style-loader - // to operate correctly into non-standard environments - // @see https://github.com/webpack-contrib/style-loader/issues/177 - return window && document && document.all && !window.atob; - }), - getElement = (function(fn) { - var memo = {}; - return function(selector) { - if (typeof memo[selector] === "undefined") { - memo[selector] = fn.call(this, selector); - } - return memo[selector] - }; - })(function (styleTarget) { - return document.querySelector(styleTarget) - }), - singletonElement = null, - singletonCounter = 0, - styleElementsInsertedAtTop = [], - fixUrls = require("./fixUrls"); - -module.exports = function(list, options) { - if(typeof DEBUG !== "undefined" && DEBUG) { - if(typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment"); - } - - options = options || {}; - options.attrs = typeof options.attrs === "object" ? options.attrs : {}; - - // Force single-tag solution on IE6-9, which has a hard limit on the # of