Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Plugins Module

const { plugins } = require( '@humanmade/webpack-helpers' );

This module provides methods which create new instances of commonly-needed Webpack plugins.

 PluginDescription
 plugins.bundleAnalyzer()Create and return a new webpack-bundle-analyzer instance. When included this plugin is disabled by default unless the --analyze flag is passed on the command line.
 plugins.clean()Create and return a new clean-webpack-plugin instance.
 plugins.copy()Create and return a new copy-webpack-plugin instance.
 plugins.errorBell()Create and return a new bell-on-bundle-error-plugin instance.
 plugins.fixStyleOnlyEntries()Create and return a webpack-fix-style-only-entries instance to remove empty JS bundles for style-only entrypoints.
Dplugins.hotModuleReplacement()Create and return a new webpack.HotModuleReplacementPlugin instance.
 plugins.manifest(): Create and return a new webpack-manifest-plugin instance, preconfigured to write the manifest file while running from a dev server.
Pplugins.miniCssExtract()Create and return a new mini-css-extract-plugin instance.
Pplugins.terser()Create and return a new terser-webpack-plugin instance, preconfigured with defaults based on create-react-app.

P: Included in presets.production()

D: Included in presets.development()