Skip to content

Latest commit

 

History

History
56 lines (43 loc) · 1.54 KB

README.md

File metadata and controls

56 lines (43 loc) · 1.54 KB

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()
    ]
}