style-loader
Advanced tools
Comparing version 0.10.2 to 0.11.0
13
index.js
@@ -19,10 +19,13 @@ /* | ||
"var update = require(" + loaderUtils.stringifyRequest(this, "!" + path.join(__dirname, "addStyles.js")) + ")(content, " + JSON.stringify(query) + ");", | ||
"if(content.placeholders) module.exports = content.placeholders;", | ||
"// Hot Module Replacement", | ||
"if(module.hot) {", | ||
" // When the styles change, update the <style> tags", | ||
" module.hot.accept(" + loaderUtils.stringifyRequest(this, "!!" + remainingRequest) + ", function() {", | ||
" var newContent = require(" + loaderUtils.stringifyRequest(this, "!!" + remainingRequest) + ");", | ||
" if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];", | ||
" update(newContent);", | ||
" });", | ||
" if(!content.placeholders) {", | ||
" module.hot.accept(" + loaderUtils.stringifyRequest(this, "!!" + remainingRequest) + ", function() {", | ||
" var newContent = require(" + loaderUtils.stringifyRequest(this, "!!" + remainingRequest) + ");", | ||
" if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];", | ||
" update(newContent);", | ||
" });", | ||
" }", | ||
" // When the module is disposed, remove the <style> tags", | ||
@@ -29,0 +32,0 @@ " module.hot.dispose(function() { update(); });", |
{ | ||
"name": "style-loader", | ||
"version": "0.10.2", | ||
"version": "0.11.0", | ||
"author": "Tobias Koppers @sokra", | ||
@@ -5,0 +5,0 @@ "description": "style loader module for webpack", |
@@ -23,2 +23,13 @@ # style loader for webpack | ||
### Placeholders | ||
(experimental) | ||
When using placeholders (see css-loader) the module exports the placeholders object: | ||
``` js | ||
var styles = require("style!css!./file.css"); | ||
style.placeholder1 === "z849f98ca812bc0d099a43e0f90184" | ||
``` | ||
### Reference-counted API | ||
@@ -25,0 +36,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
13183
315
77