CSS Hot Loader
This is a css hot loader. And this loader support extract-text-webpack-plugin.
Why we need css hot loader
In most cases, we can realize css hot reload by style-loader . But style-loader need inject style tag into document, Before js ready, the web page will have no any style. That is not good experience.
Also, a lots of people thought about that, How can realize hot reload with
extract-text-webpack-plugin. For example #30 , #!89.
So I write this loader, which supprot hot module replacement for an extracted css file.
Install
First install package from npm
$ npm install css-hot-loader --save-dev
Then config webpack.config.js
module: {
loaders: [{
test: /\.less$/,
loaders: [
'css-hot-loader',
'extract-text-webpack-plugin',
'less',
...
],
include: path.join(__dirname, 'src')
}]
}
css-hot-loader
should be the first loader before extract-text-webpack-plugin
.
How