css-hot-loader
Advanced tools
Comparing version 1.1.0-beta2 to 1.1.0-beta3
@@ -0,1 +1,5 @@ | ||
### 1.1.0 / 2017-05-14 | ||
- Add option fileMap, fix [#3](https://github.com/shepherdwind/css-hot-loader/issues/3) | ||
### 1.0.3 / 2017-05-05 | ||
@@ -2,0 +6,0 @@ |
@@ -0,1 +1,3 @@ | ||
var normalizeUrl = require('normalize-url'); | ||
var getCurrentScriptUrl = function() { | ||
@@ -20,3 +22,3 @@ var src; | ||
var reg = new RegExp(filename + '\\.js$', 'g') | ||
return src.replace(reg, mapRule.replace(/{fileName}/g, filename) + '.css'); | ||
return normalizeUrl(src.replace(reg, mapRule.replace(/{fileName}/g, filename) + '.css')); | ||
}); | ||
@@ -42,2 +44,3 @@ }; | ||
function getReloadUrl(href, src) { | ||
href = normalizeUrl(href); | ||
var ret; | ||
@@ -44,0 +47,0 @@ src.some(function(url) { |
{ | ||
"name": "css-hot-loader", | ||
"version": "1.1.0-beta2", | ||
"version": "1.1.0-beta3", | ||
"description": "css hot reload work with extract-text-webpack-plugin", | ||
@@ -18,4 +18,5 @@ "main": "index.js", | ||
"dependencies": { | ||
"loader-utils": "^1.1.0" | ||
"loader-utils": "^1.1.0", | ||
"normalize-url": "^1.9.1" | ||
} | ||
} |
@@ -68,2 +68,18 @@ ### CSS Hot Loader | ||
### options | ||
#### fileMap | ||
Option to define you css file reload rule. | ||
For example `'css-hot-loader?fileMap='../css/{fileName}'` , which mean | ||
``` | ||
js/foo.js => css/foo.css | ||
``` | ||
Default value is `{fileName}`. | ||
see [#3](https://github.com/shepherdwind/css-hot-loader/issues/3). | ||
### How | ||
@@ -70,0 +86,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
8428
8
89
101
2
+ Addednormalize-url@^1.9.1
+ Addedis-plain-obj@1.1.0(transitive)
+ Addednormalize-url@1.9.1(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedprepend-http@1.0.4(transitive)
+ Addedquery-string@4.3.4(transitive)
+ Addedsort-keys@1.1.2(transitive)
+ Addedstrict-uri-encode@1.1.0(transitive)