style-loader
Advanced tools
Comparing version 0.22.1 to 0.23.0
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="0.23.0"></a> | ||
# [0.23.0](https://github.com/webpack-contrib/style-loader/compare/v0.22.1...v0.23.0) (2018-08-27) | ||
### Features | ||
* **useable:** add `insertInto` support (`options.insertInto`) ([#341](https://github.com/webpack-contrib/style-loader/issues/341)) ([2588aca](https://github.com/webpack-contrib/style-loader/commit/2588aca)) | ||
<a name="0.22.1"></a> | ||
@@ -7,0 +17,0 @@ ## [0.22.1](https://github.com/webpack-contrib/style-loader/compare/v0.22.0...v0.22.1) (2018-08-08) |
{ | ||
"name": "style-loader", | ||
"version": "0.22.1", | ||
"version": "0.23.0", | ||
"author": "Tobias Koppers @sokra", | ||
@@ -5,0 +5,0 @@ "description": "style loader module for webpack", |
@@ -21,2 +21,17 @@ /* | ||
// The variable is needed, because the function should be inlined. | ||
// If is just stored it in options, JSON.stringify will quote | ||
// the function and it would be just a string at runtime | ||
var insertInto; | ||
if (typeof options.insertInto === "function") { | ||
insertInto = options.insertInto.toString(); | ||
} | ||
// We need to check if it a string, or variable will be "undefined" | ||
// and the loader crashes | ||
if (typeof options.insertInto === "string") { | ||
insertInto = '"' + options.insertInto + '"'; | ||
} | ||
var hmr = [ | ||
@@ -52,2 +67,4 @@ // Hot Module Replacement | ||
"var content = require(" + loaderUtils.stringifyRequest(this, "!!" + request) + ");", | ||
"var options = " + JSON.stringify(options) + ";", | ||
"options.insertInto = " + insertInto + ";", | ||
"", | ||
@@ -60,3 +77,3 @@ "if(typeof content === 'string') content = [[module.id, content, '']];", | ||
" if(!(refs++)) {", | ||
" dispose = require(" + loaderUtils.stringifyRequest(this, "!" + path.join(__dirname, "lib", "addStyles.js")) + ")(content, " + JSON.stringify(options) + ");", | ||
" dispose = require(" + loaderUtils.stringifyRequest(this, "!" + path.join(__dirname, "lib", "addStyles.js")) + ")(content, options);", | ||
" }", | ||
@@ -63,0 +80,0 @@ "", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45202
655