AMDPlugin(options, amdOptions)

lib/dependencies/AMDPlugin.js

Provides AMD-style define and require to modules. Also bind require.amd, define.amd and __webpack_amd_options__ to the options passed as parameter.

Parameters

  • options :
  • amdOptions :

APIPlugin

lib/APIPlugin.js

Make __webpack_public_path__, __webpack_require__, __webpack_modules__, __webpack_chunk_load__ accessible. Ensures that require.valueOf and require.onError are not processed by other plugins.

CachePlugin(cache)

lib/CachePlugin.js

Adds a cache to the compiler, where modules are cached.

You can pass a cache object, where the modules are cached. Otherwise one is created per plugin instance.

Parameters

  • cache :

CommonJsPlugin(options)

lib/dependencies/CommonJsPlugin.js

Provides CommonJs-style require to modules.

Parameters

  • options :

CompatibilityPlugin

lib/CompatibilityPlugin.js

Currently useless. Ensures compatibility with other module loaders.

ConstPlugin

lib/ConstPlugin.js

Try to evaluate expressions in if(...) and replace it with true/false.

DedupePlugin

lib/optimize/DedupePlugin.js

Deduplicates modules and adds runtime code.

DefinePlugin(definitions)

lib/DefinePlugin.js

Define constants for identifier.

definitions is an object.

Parameters

  • definitions :

FlagIncludedChunksPlugin

lib/optimize/FlagIncludedChunksPlugin.js

Adds chunk ids of chunks which are included in the chunk. This eliminates unnecessary chunk loads.

FunctionModulePlugin(options, requestShortener)

lib/FunctionModulePlugin.js

Each emitted module is wrapped in a function.

options are the output options.

If options.pathinfo is set, each module function is annotated with a comment containing the module identifier shortened to context (absolute path).

Parameters

  • options :
  • requestShortener :

HotModuleReplacementPlugin(options)

lib/HotModuleReplacementPlugin.js

Add support for hot module replacement. Decorates the templates to add runtime code. Adds module.hot API.

options.hotUpdateChunkFilename The filename for hot update chunks

options.hotUpdateMainFilename The filename for the hot update manifest

options.hotUpdateFunction JSON function name for the hot update

Parameters

  • options :

JsonpTemplatePlugin

lib/JsonpTemplatePlugin.js

Chunks are wrapped into JSONP-calls. A loading algorithm is included in entry chunks. It loads chunks by adding a <script> tag.

options are the output options.

options.jsonpFunction is the JSONP function.

options.publicPath is uses as path for loading the chunks.

options.chunkFilename is the filename under that chunks are expected.

LabeledModulesPlugin

lib/dependencies/LabeledModulesPlugin.js

Provide labels require: and exports: to modules.

LibraryTemplatePlugin(name, target, umdNamedDefine)

lib/LibraryTemplatePlugin.js

The entries chunks are decorated to form a library name of type type.

Parameters

  • name :
  • target :
  • umdNamedDefine :

LimitChunkCountPlugin(options)

lib/optimize/LimitChunkCountPlugin.js

Merge chunks limit chunk count is lower than options.maxChunks.

The overhead for each chunks is provided by options.chunkOverhead or defaults to 10000. Entry chunks sizes are multiplied by options.entryChunkMultiplicator (or 10).

Chunks that reduce the total size the most are merged first. If multiple combinations are equal the minimal merged size wins.

Parameters

  • options :

MergeDuplicateChunksPlugin

lib/optimize/MergeDuplicateChunksPlugin.js

Chunks with the same modules are merged.

MinChunkSizePlugin(options)

lib/optimize/MinChunkSizePlugin.js

Merges chunks until each chunk has the minimum size of minChunkSize.

Parameters

  • options :

MultiEntryPlugin(context, entries, name)

lib/MultiEntryPlugin.js

Adds a entry chunk on compilation. The chunk is named chunkName and contains a module for each item in the requests array (plus dependencies). Each item in requests is resolved in context (absolute path).

Parameters

  • context :
  • entries :
  • name :

NodeEnvironmentPlugin

lib/node/NodeEnvironmentPlugin.js

Applies node.js style filesystem to the compiler.

NodeSourcePlugin(options)

lib/node/NodeSourcePlugin.js

This module adds stuff from node.js that is not available in non-node.js environments.

It adds polyfills for process, console, Buffer and global if used. It also binds the built in Node.js replacement modules.

Parameters

  • options :

NodeStuffPlugin(options)

lib/NodeStuffPlugin.js

Provide stuff that is normally available in node.js modules.

It also ensures that module is filled with some node.js stuff if you use it.

Parameters

  • options :

NodeTargetPlugin

lib/node/NodeTargetPlugin.js

The plugins should be used if you run the bundle in a node.js environment.

If ensures that native modules are loaded correctly even if bundled.

NodeTemplatePlugin(options)

lib/node/NodeTemplatePlugin.js

Chunks are wrapped into node.js modules exporting the bundled modules. The entry chunks loads chunks by requiring them.

options are the output options.

options.chunkFilename is the filename under that chunks are expected.

Parameters

  • options :

OccurrenceOrderPlugin(preferEntry)

lib/optimize/OccurrenceOrderPlugin.js

Order the modules and chunks by occurrence. This saves space, because often referenced modules and chunks get smaller ids.

preferEntry If true, references in entry chunks have higher priority

Parameters

  • preferEntry :

PrefetchPlugin(context, request)

lib/PrefetchPlugin.js

Prefetches request and dependencies to enables more parallel compilation. It doesn't create any chunk. The module is resolved from request in context (absolute path).

Parameters

  • context :
  • request :

ProgressPlugin(options)

lib/ProgressPlugin.js

Hook into the compiler to extract progress information. The handler must have the signature function(percentage, message). It's called with 0 <= percentage <= 1. percentage == 0 indicates the start. percentage == 1 indicates the end.

Parameters

  • options :

ProvidePlugin(definitions)

lib/ProvidePlugin.js

If name is used in a module it is filled by a module loaded by require(<request>).

Parameters

  • definitions :

RecordIdsPlugin

lib/RecordIdsPlugin.js

Saves and restores module and chunk ids from records.

RemoveEmptyChunksPlugin

lib/optimize/RemoveEmptyChunksPlugin.js

Modules that are included in every parent chunk are removed from the chunk.

RequireContextPlugin(modulesDirectories, extensions)

lib/dependencies/RequireContextPlugin.js

Provides require.context. The parameter modulesDirectories and extensions are used to find alternative requests for files. It's useful to provide the same arrays as you provide to the resolver.

Parameters

  • modulesDirectories :
  • extensions :

RequireEnsurePlugin

lib/dependencies/RequireEnsurePlugin.js

Provides require.ensure.

RequireIncludePlugin

lib/dependencies/RequireIncludePlugin.js

Provides require.include.

RequireJsStuffPlugin

lib/RequireJsStuffPlugin.js

Provide stuff that is normally available in require.js.

require[js].config is removed. require.version is 0.0.0. requirejs.onError is mapped to require.onError.

SingleEntryPlugin(context, entry, name)

lib/SingleEntryPlugin.js

Adds a entry chunk on compilation. The chunk is named chunkName and contains only one module (plus dependencies). The module is resolved from request in context (absolute path).

Parameters

  • context :
  • entry :
  • name :

SourceMapDevToolPlugin(options)

lib/SourceMapDevToolPlugin.js

Decorates the templates by generating a SourceMap for each chunk.

sourceMapFilename the filename template of the SourceMap. [hash], [name], [id], [file] and [filebase] are replaced. If this argument is missing, the SourceMap will be inlined as DataUrl.

Parameters

  • options :

UglifyJsPlugin(options)

lib/optimize/UglifyJsPlugin.js

Minimizes the chunks with uglify.js.

options are uglifyjs options.

Parameters

  • options :

WebWorkerTemplatePlugin

lib/webworker/WebWorkerTemplatePlugin.js

Chunks are loaded by importScripts. Else it's similar to JsonpTemplatePlugin.

options are the output options.