Skip to content

thenengah/extract-css-hmr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

extract-css-hmr

This is a node module which exposes a webpack loader and plugin to extract css from hot module reloads.

Problem

You are trying to hot reload css server side and you use ExtractTextWebpackPLugin.

Solution

Use ExtractTextWebpackPLugin for production and ExtractCssHMR (this module) for development.

Install

  npm install extract-css-hmr --save-dev

Config

Add the loader and plugin to you webpack config.

  module: {
    rules: [{
      test: /\.scss$/,
      use: [
        'style-loader',
        'css-loader',
        'extract-css-hmr/loader',
        'sass-loader'
      ]
    }]
  },
  plugins: [
    new ExtractCssHmrPlugin({
      identify: '[name]-[hash].css'
    })
  ]
``

About

Extract CSS from hot module reloading

Resources

License

Stars

Watchers

Forks

Packages

No packages published