hmr-filter-webpack-plugin

1.0.0 • Public • Published

hmr-filter-webpack-plugin

NPM version Node version Dependencies status Build status Dependabot badge

Disable Hot Module Replacement for certain chunks.

Install

npm i -D hmr-filter-webpack-plugin
# or 
yarn add -D hmr-filter-webpack-plugin

Usage

// webpack.config.js
const {
    HotModuleReplacementFilterPlugin 
= require('hmr-filter-webpack-plugin');
// ...
{
    plugins: [
        // Disable HMR for `worker-loader` and `service-worker-loader`
        new HotModuleReplacementFilterPlugin((compilation) => {
 
            const {
                name 
            } = compilation.compiler;
 
            return name && name.includes('worker');
        }),
        new webpack.HotModuleReplacementPlugin()
    ]
}

Package Sidebar

Install

npm i hmr-filter-webpack-plugin

Weekly Downloads

60

Version

1.0.0

License

MIT

Unpacked Size

6.14 kB

Total Files

7

Last publish

Collaborators

  • dangreen