Skip to content

Commit

Permalink
docs(plugins): update internal plugins (webpack#3737)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenxsan committed May 11, 2020
1 parent 6fc84dc commit 70997ff
Showing 1 changed file with 4 additions and 45 deletions.
49 changes: 4 additions & 45 deletions src/content/plugins/internal-plugins.md
Expand Up @@ -5,6 +5,7 @@ contributors:
- EugeneHlushko
- ooflorent
- Legends
- chenxsan
---

This is a list of plugins which are used by webpack internally.
Expand Down Expand Up @@ -34,13 +35,11 @@ Applies Node.js style filesystem to the compiler.

Plugins affecting the compiler

### CachePlugin
### MemoryCachePlugin

`CachePlugin([cache])`
`MemoryCachePlugin()`

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.
Adds a cache to the compiler, where modules are cached in memory.

### ProgressPlugin

Expand All @@ -64,12 +63,6 @@ Plugins, which add entry chunks to the compilation.

Adds an 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).

### MultiEntryPlugin

`MultiEntryPlugin(context, requests, chunkName)`

Adds an 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).

### PrefetchPlugin

`PrefetchPlugin(context, request)`
Expand All @@ -78,16 +71,6 @@ Prefetches `request` and dependencies to enable a more parallel compilation. It

## output

### FunctionModulePlugin

`FunctionModulePlugin(context, options)`

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).

### JsonpTemplatePlugin

`JsonpTemplatePlugin(options)`
Expand Down Expand Up @@ -168,10 +151,6 @@ Make webpack_public_path, webpack_require, webpack_modules and webpack_chunk_loa

Currently useless. Ensures compatibility with other module loaders.

### ConsolePlugin

Offers a pseudo `console` if it is not available.

### ConstPlugin

Tries to evaluate expressions in `if (...)` statements and ternaries to replace them with `true`/`false` for further possible dead branch elimination using hooks fired by the parser.
Expand Down Expand Up @@ -245,12 +224,6 @@ Provides AMD-style `define` and `require` to modules. Also bind `require.amd`, `

Provides CommonJs-style `require` to modules.

### LabeledModulesPlugin

`dependencies/LabeledModulesPlugin()`

Provide labels `require:` and `exports:` to modules.

### RequireContextPlugin

`dependencies/RequireContextPlugin(modulesDirectories, extensions)`
Expand Down Expand Up @@ -312,17 +285,3 @@ Merges chunks until each chunk has the minimum size of `minChunkSize`.
`optimize/FlagIncludedChunksPlugin()`

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

### OccurenceOrderPlugin

`optimize/OccurrenceOrderPlugin(preferEntry)`

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

### DedupePlugin

`optimize/DedupePlugin()`

Deduplicates modules and adds runtime code.

0 comments on commit 70997ff

Please sign in to comment.