Socket
Socket
Sign inDemoInstall

css-hot-loader

Package Overview
Dependencies
0
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.0.2-beta

4

History.md

@@ -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();
}
};

2

loader.js

@@ -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)
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc