summaryrefslogtreecommitdiffstats
path: root/node_modules/style-loader/lib/addStyleUrl.js
diff options
context:
space:
mode:
authorGravatar Piotr Russ <mail@pruss.it> 2020-11-18 23:26:45 +0100
committerGravatar Piotr Russ <mail@pruss.it> 2020-11-18 23:26:45 +0100
commit81ddf9b700bc48a1f8e472209f080f9c1d9a9b09 (patch)
tree8b959d50c5a614cbf9fcb346ed556140374d4b6d /node_modules/style-loader/lib/addStyleUrl.js
parent1870f3fdf43707a15fda0f609a021f516f45eb63 (diff)
downloadwebsite_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.gz
website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.bz2
website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.zip
rm node_modules
Diffstat (limited to 'node_modules/style-loader/lib/addStyleUrl.js')
-rw-r--r--node_modules/style-loader/lib/addStyleUrl.js44
1 files changed, 0 insertions, 44 deletions
diff --git a/node_modules/style-loader/lib/addStyleUrl.js b/node_modules/style-loader/lib/addStyleUrl.js
deleted file mode 100644
index 581fecb..0000000
--- a/node_modules/style-loader/lib/addStyleUrl.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- MIT License http://www.opensource.org/licenses/mit-license.php
- Author Tobias Koppers @sokra
-*/
-
-function addAttrs (element, attrs) {
- Object.keys(attrs).forEach(function (key) {
- element.setAttribute(key, attrs[key]);
- });
-}
-
-module.exports = function addStyleUrl (url, 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 : {};
-
- options.hmr = typeof options.hmr === 'undefined' ? true : options.hmr;
-
- var link = document.createElement("link");
-
- link.rel = "stylesheet";
- link.type = "text/css";
- link.href = url;
-
- addAttrs(link, options.attrs);
-
- var head = document.getElementsByTagName("head")[0];
-
- head.appendChild(link);
-
- if (options.hmr && module.hot) {
- return function(url) {
- if(typeof url === "string") {
- link.href = url;
- } else {
- head.removeChild(link);
- }
- };
- }
-}