Socket
Socket
Sign inDemoInstall

style-loader

Package Overview
Dependencies
Maintainers
1
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

style-loader - npm Package Compare versions

Comparing version 0.6.5 to 0.7.0

16

addStyle.js

@@ -18,5 +18,15 @@ /*

}
return function() {
head.removeChild(styleElement);
};
if(module.hot) {
return function(cssCode) {
if(typeof cssCode === "string") {
if (styleElement.styleSheet) {
styleElement.styleSheet.cssText = cssCode;
} else {
styleElement.childNodes[0].nodeValue = cssCode;
}
} else {
head.removeChild(styleElement);
}
};
}
}

12

addStyleUrl.js

@@ -15,5 +15,11 @@ /*

head.appendChild(styleElement);
return function() {
head.removeChild(styleElement);
};
if(module.hot) {
return function(cssUrl) {
if(typeof cssUrl === "string") {
styleElement.href = cssUrl;
} else {
head.removeChild(styleElement);
}
};
}
}

@@ -9,9 +9,15 @@ /*

this.cacheable && this.cacheable();
var comment1 = "// style-loader: Adds some css to the DOM by adding a <style> tag\n";
var addStyleCode = "var dispose = require(" + JSON.stringify("!" + path.join(__dirname, "addStyle.js")) + ")\n";
var comment2 = "\t// The css code:\n";
var cssCodeRequest = "require(" + JSON.stringify("!!" + remainingRequest) + ")";
var comment3 = "// Hot Module Replacement\n";
var hmrCode = "if(module.hot) {\n\tmodule.hot.accept();\n\tmodule.hot.dispose(dispose);\n}";
return comment1 + addStyleCode + comment2 + "\t(" + cssCodeRequest + ");\n" + comment3 + hmrCode;
return [
"// style-loader: Adds some css to the DOM by adding a <style> tag",
"var update = require(" + JSON.stringify("!" + path.join(__dirname, "addStyle.js")) + ")(",
"\trequire(" + JSON.stringify("!!" + remainingRequest) + ")",
");",
"// Hot Module Replacement",
"if(module.hot) {",
"\tmodule.hot.accept(" + JSON.stringify("!!" + remainingRequest) + ", function() {",
"\t\tupdate(require(" + JSON.stringify("!!" + remainingRequest) + "));",
"\t});",
"\tmodule.hot.dispose(function() { update(); });",
"}"
].join("\n");
};
{
"name": "style-loader",
"version": "0.6.5",
"version": "0.7.0",
"author": "Tobias Koppers @sokra",

@@ -5,0 +5,0 @@ "description": "style loader module for webpack",

@@ -9,9 +9,15 @@ /*

this.cacheable && this.cacheable();
var comment1 = "// style-loader: Adds some css to the DOM by adding a <style> tag\n";
var addStyleCode = "var dispose = require(" + JSON.stringify("!" + path.join(__dirname, "addStyleUrl.js")) + ")\n";
var comment2 = "\t// The url to the css code:\n";
var cssUrlRequest = "require(" + JSON.stringify("!!" + remainingRequest) + ")";
var comment3 = "// Hot Module Replacement\n";
var hmrCode = "if(module.hot) {\n\tmodule.hot.accept();\n\tmodule.hot.dispose(dispose);\n}";
return comment1 + addStyleCode + comment2 + "\t(" + cssUrlRequest + ");\n" + comment3 + hmrCode;
return [
"// style-loader: Adds some reference to a css file to the DOM by adding a <link> tag",
"var update = require(" + JSON.stringify("!" + path.join(__dirname, "addStyleUrl.js")) + ")(",
"\trequire(" + JSON.stringify("!!" + remainingRequest) + ")",
");",
"// Hot Module Replacement",
"if(module.hot) {",
"\tmodule.hot.accept(" + JSON.stringify("!!" + remainingRequest) + ", function() {",
"\t\tupdate(require(" + JSON.stringify("!!" + remainingRequest) + "));",
"\t});",
"\tmodule.hot.dispose(function() { update(); });",
"}"
].join("\n");
};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc