Skip to content

Disable Hot Module Replacement for certain chunks.

License

Notifications You must be signed in to change notification settings

TrigenSoftware/hmr-filter-webpack-plugin

Repository files navigation

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

About

Disable Hot Module Replacement for certain chunks.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published