Skip to content
This repository has been archived by the owner on Aug 8, 2019. It is now read-only.

webpack plugins

Tobias Koppers edited this page Dec 3, 2013 · 37 revisions

webpack plugins

config

webpack/lib/NormalModuleReplacementPlugin(resourceRegExp, newResource)

Replace resources that matches resourceRegExp with newResource.

webpack/lib/ContextReplacementPlugin(resourceRegExp, newContentRegExp)

Replaces the default regExp generated by parsing with newContextRegExp if the resource (directory) matches resourceRegExp.

webpack/lib/IgnorePlugin(requestRegExp)

Don't generate modules for requests matching the provided RegExp.

webpack/lib/BannerPlugin(banner, options)

Adds a banner to the top of each generated chunk.

banner a string, it will be wrapped in a comment

options.raw if true, banner will not be wrapped in a comment

options.entryOnly if true, the banner will only be added to the entry chunks.

webpack/lib/optimize/CommonsChunkPlugin(filename, [entryPoints], [minChunks])

Generates a extra chunk, which contains common modules shared between at least minChunks entry points. You need to load the generated chunk before the entry point:

<script src="commons.js" charset="utf-8"></script>
<script src="entry.bundle.js" charset="utf-8"></script>

filename the filename of the commons chunk (like output.filename). Accepts [hash], [chunkhash], etc.

entryPoints an array of entry points that should be used to generate these commons chunk. By default all entry points will be used.

minChunks the number of entry point that need to have a module in common. By default it need to be in all entry points. Allowed values are >= 2, <= entry points count.

module styles

Use component with webpack.

dependency injection

Use rewire in webpack.

localization

Create bundles with translations baked in. Then you can serve the translated bundle to your clients.

other


For a list of plugins used by webpack internally see internal webpack plugins

Clone this wiki locally