css-hot-loader
Advanced tools
Comparing version 1.0.1 to 1.0.2-beta
@@ -0,3 +1,7 @@ | ||
### 1.0.2 / 2017-04-05 | ||
- css file change md5 hash , support webpack 2.0, fix issue [#1](https://github.com/shepherdwind/css-hot-loader/issues/1) | ||
### 1.0.1 / 2017-01-26 | ||
- First version, work fine |
@@ -24,2 +24,9 @@ var getCurrentScriptUrl = function() { | ||
function reloadAll() { | ||
document.querySelectorAll('link').forEach(el => { | ||
const src = el.split('?')[0]; | ||
el.href = src + '?' + Date.now(); | ||
}); | ||
} | ||
module.exports = function() { | ||
@@ -35,3 +42,5 @@ if (typeof document === 'undefined') { | ||
console.log('[HMR] css reload %s', src); | ||
} else { | ||
reloadAll(); | ||
} | ||
}; |
@@ -5,3 +5,3 @@ module.exports = function(content) { | ||
if(module.hot) { | ||
const cssReload = require('${require.resolve('./hotModuleReplacement')}'); | ||
const cssReload = require('${require.resolve('./hotModuleReplacement')}?${Date.now()}'); | ||
module.hot.dispose(cssReload); | ||
@@ -8,0 +8,0 @@ module.hot.accept(undefined, cssReload); |
{ | ||
"name": "css-hot-loader", | ||
"version": "1.0.1", | ||
"version": "1.0.2-beta", | ||
"description": "css hot reload work with extract-text-webpack-plugin", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -50,2 +50,20 @@ ### CSS Hot Loader | ||
### webpack 2.x | ||
Config file example should like this | ||
``` | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.css$/, | ||
use: ['css-hot-loader'].concat(ExtractTextPlugin.extract({ | ||
fallback: 'style-loader', | ||
use: 'css-loader' | ||
})), | ||
}, | ||
] | ||
} | ||
``` | ||
### How | ||
@@ -67,2 +85,2 @@ | ||
(The MIT License) | ||
(The MIT License) |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
5642
50
85
3