Plugins

Webpack has a rich plugin interface. Most of the features within webpack itself use this plugin interface. This makes webpack flexible.

NameDescription
BannerPluginAdd a banner to the top of each generated chunk
ChunksWebpackPluginCreate HTML files with entrypoints and chunks relations to serve your bundles
CompressionWebpackPluginPrepare compressed versions of assets to serve them with Content-Encoding
ContextReplacementPluginOverride the inferred context of a require expression
CopyPluginCopy files and directories into the output directory
CopyWebpackPluginDeprecated in favour of the built-in CopyPlugin
DefinePluginAllow global constants configured at compile time
DiagnosticsWebpackPluginRun linters and other diagnostic tools over your sources during the build
DllPluginSplit bundles in order to drastically improve build time
EnvironmentPluginShorthand for using the DefinePlugin on process.env keys
HotModuleReplacementPluginEnable Hot Module Replacement (HMR)
IgnorePluginExclude certain modules from bundles
LimitChunkCountPluginSet min/max limits for chunking to better control chunking
MergeDuplicateChunksPluginMerge chunks that contain the same modules
MinChunkSizePluginKeep chunk size above the specified limit
NoEmitOnErrorsPluginSkip the emitting phase when there are compilation errors
NormalModuleReplacementPluginReplace resource(s) that matches a regexp
ProgressPluginReport compilation progress
ProvidePluginUse modules without having to use import/require
SourceMapDevToolPluginEnables a more fine grained control of source maps
EvalSourceMapDevToolPluginEnables a more fine grained control of eval source maps
SvgChunkWebpackPluginGenerate SVG sprites optimized by SVGO based on your entry point dependencies
MinimizerPluginUses Terser (or other) to minify the JS/CSS/HTML/JSON/etc in your project

For more third-party plugins, see the list from awesome-webpack.

Edit this page·

10 Contributors

simon04gonzoyumorouzbeh84aretecodeeko3alpharefactorizedbyzykEugeneHlushkosnitin315chenxsan