Miss any of our Open RFC calls?Watch the recordings here! »

extract-css-hmr

0.0.5 • Public • Published

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({
      filename: '[name]-[hash].css'
    })
  ]
``

Keywords

none

Install

npm i extract-css-hmr

DownloadsWeekly Downloads

1

Version

0.0.5

License

none

Unpacked Size

7.47 kB

Total Files

10

Last publish

Collaborators

  • avatar