Skip to content

Commit a6fd31f

Browse files
committed
docs(config,plugins) type updates
1 parent f14f8fd commit a6fd31f

File tree

5 files changed

+53
-24
lines changed

5 files changed

+53
-24
lines changed

src/content/configuration/output.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,20 +87,44 @@ module.exports = {
8787

8888
## `output.chunkFilename`
8989

90-
`string`
90+
`string = '[id].js'`
9191

9292
This option determines the name of non-entry chunk files. See [`output.filename`](#outputfilename) option for details on the possible values.
9393

9494
Note that these filenames need to be generated at runtime to send the requests for chunks. Because of this, placeholders like `[name]` and `[chunkhash]` need to add a mapping from chunk id to placeholder value to the output bundle with the webpack runtime. This increases the size and may invalidate the bundle when placeholder value for any chunk changes.
9595

9696
By default `[id].js` is used or a value inferred from [`output.filename`](#outputfilename) (`[name]` is replaced with `[id]` or `[id].` is prepended).
9797

98+
__webpack.config.js__
99+
100+
```javascript
101+
module.exports = {
102+
//...
103+
output: {
104+
//...
105+
chunkFilename: `[id].js`
106+
}
107+
};
108+
```
109+
98110

99111
## `output.chunkLoadTimeout`
100112

101-
`number`
113+
`number = 120000`
102114

103-
Number of milliseconds before chunk request expires, defaults to 120 000. This option is supported since webpack 2.6.0.
115+
Number of milliseconds before chunk request expires. This option is supported since webpack 2.6.0.
116+
117+
__webpack.config.js__
118+
119+
```javascript
120+
module.exports = {
121+
//...
122+
output: {
123+
//...
124+
chunkLoadTimeout: 30000
125+
}
126+
};
127+
```
104128

105129

106130
## `output.crossOriginLoading`

src/content/plugins/progress-plugin.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ contributors:
66
- byzyk
77
---
88

9-
`object` `function (percentage: number, message: string, ...args: string[])`
9+
`
10+
object = { boolean activeModules = true, boolean entries = false, function (number percentage, string message, [string] ...args) handler, boolean modules = true, number modulesCount = 500, boolean profile = false }`
11+
12+
`function (number percentage, string message, [string] ...args)`
1013

1114
The `ProgressPlugin` provides a way to customize how progress is reported during a compilation.
1215

@@ -15,7 +18,7 @@ The `ProgressPlugin` provides a way to customize how progress is reported during
1518
Create an instance of `ProgressPlugin` and provide one of the allowed params.
1619

1720
### Providing `function`
18-
21+
1922
Provide a handler function which will be called when hooks report progress. `handler` function arguments:
2023

2124
- `percentage`: a number between 0 and 1 indicating the completion percentage of the compilation
@@ -36,12 +39,12 @@ new webpack.ProgressPlugin(handler);
3639

3740
When providing an `object` to the `ProgressPlugin`, following properties are supported:
3841

39-
- `activeModules: boolean = true` show's active modules count and one active module in progress message
40-
- `entries: boolean = false` show's entries count in progress message
41-
- [`handler: function(percentage, message, ...args)`](#providing-function)
42-
- `modules: boolean = true` show's modules count in progress message
43-
- `modulesCount: number = 500` a minimum modules count to start with. Takes effect when `modules` property is enabled.
44-
- `profile: true | false | null = false` tells `ProgressPlugin` to collect profile data for progress steps.
42+
- `activeModules` show's active modules count and one active module in progress message
43+
- `entries` show's entries count in progress message
44+
- [`handler: function (percentage, message, ...args)`](#providing-function)
45+
- `modules` show's modules count in progress message
46+
- `modulesCount` a minimum modules count to start with. Takes effect when `modules` property is enabled.
47+
- `profile` tells `ProgressPlugin` to collect profile data for progress steps.
4548

4649

4750
```js

src/content/plugins/source-map-dev-tool-plugin.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ contributors:
55
- simon04
66
- neilkennedy
77
- byzyk
8+
- EugeneHlushko
89
related:
910
- title: Building Source Maps
1011
url: https://survivejs.com/webpack/building/source-maps/#-sourcemapdevtoolplugin-and-evalsourcemapdevtoolplugin-
@@ -21,18 +22,18 @@ new webpack.SourceMapDevToolPlugin(options);
2122

2223
The following options are supported:
2324

24-
- `test` (`string|regex|array`): Include source maps for modules based on their extension (defaults to `.js`, `.mjs`, and `.css`).
25-
- `include` (`string|regex|array`): Include source maps for module paths that match the given value.
26-
- `exclude` (`string|regex|array`): Exclude modules that match the given value from source map generation.
25+
- `test` (`string` `RegExp` `[string, RegExp]`): Include source maps for modules based on their extension (defaults to `.js`, `.mjs`, and `.css`).
26+
- `include` (`string` `RegExp` `[string, RegExp]`): Include source maps for module paths that match the given value.
27+
- `exclude` (`string` `RegExp` `[string, RegExp]`): Exclude modules that match the given value from source map generation.
2728
- `filename` (`string`): Defines the output filename of the SourceMap (will be inlined if no value is provided).
2829
- `append` (`string`): Appends the given value to the original asset. Usually the `#sourceMappingURL` comment. `[url]` is replaced with a URL to the source map file. `false` disables the appending.
2930
- `moduleFilenameTemplate` (`string`): See [`output.devtoolModuleFilenameTemplate`](/configuration/output/#outputdevtoolmodulefilenametemplate).
3031
- `fallbackModuleFilenameTemplate` (`string`): See link above.
3132
- `namespace` (`string`): See [`output.devtoolNamespace`](/configuration/output/#outputdevtoolnamespace).
32-
- `module` (`boolean`): Indicates whether loaders should generate source maps (defaults to `true`).
33-
- `columns` (`boolean`): Indicates whether column mappings should be used (defaults to `true`).
34-
- `lineToLine` (`boolean` or `object`): Simplify and speed up source mapping by using line to line source mappings for matched modules.
35-
- `noSources` (`boolean`): Prevents the source file content from being included in the source map (defaults to `false`).
33+
- `module = true` (`boolean`): Indicates whether loaders should generate source maps.
34+
- `columns = true` (`boolean`): Indicates whether column mappings should be used.
35+
- `lineToLine` (`boolean` `object`): Simplify and speed up source mapping by using line to line source mappings for matched modules.
36+
- `noSources = false` (`boolean`): Prevents the source file content from being included in the source map.
3637
- `publicPath` (`string`): Emits absolute URLs with public path prefix, e.g. `https://example.com/project/`.
3738
- `fileContext` (`string`): Makes the `[file]` argument relative to this directory.
3839

src/content/plugins/split-chunks-plugin.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ By default webpack will generate names using origin and name of the chunk (e.g.
8989

9090
### `splitChunks.automaticNameMaxLength`
9191

92-
`number: 109`
92+
`number = 109`
9393

9494
Allows setting a maximum character count for chunk names that are generated by the `SplitChunksPlugin`.
9595

9696
### `splitChunks.chunks`
9797

98-
`function (chunk) | string`
98+
`function (chunk)` `string`
9999

100100
This indicates which chunks will be selected for optimization. When a string is provided, valid values are `all`, `async`, and `initial`. Providing `all` can be particularly powerful, because it means that chunks can be shared even between async and non-async chunks.
101101

@@ -170,7 +170,7 @@ T> `maxSize` takes higher priority than `maxInitialRequest/maxAsyncRequests`. Ac
170170

171171
### `splitChunks.name`
172172

173-
`boolean: true | function (module, chunks, cacheGroupKey):string | string`
173+
`boolean = true` `function (module, chunks, cacheGroupKey) => string` `string`
174174

175175
Also available for each cacheGroup: `splitChunks.cacheGroups.{cacheGroup}.name`.
176176

@@ -270,7 +270,7 @@ module.exports = {
270270

271271
#### `splitChunks.cacheGroups.{cacheGroup}.test`
272272

273-
`function (module, chunk):boolean | RegExp | string`
273+
`function (module, chunk) => boolean` `RegExp` `string`
274274

275275
Controls which modules are selected by this cache group. Omitting it selects all modules. It can match the absolute module resource path or chunk names. When a chunk name is matched, all modules in the chunk are selected.
276276

@@ -322,7 +322,7 @@ module.exports = {
322322

323323
#### `splitChunks.cacheGroups.{cacheGroup}.enforce`
324324

325-
`boolean: false`
325+
`boolean = false`
326326

327327
Tells webpack to ignore [`splitChunks.minSize`](#splitchunksminsize), [`splitChunks.minChunks`](#splitchunksminchunks), [`splitChunks.maxAsyncRequests`](#splitchunksmaxasyncrequests) and [`splitChunks.maxInitialRequests`](#splitchunksmaxinitialrequests) options and always create chunks for this cache group.
328328

src/content/plugins/watch-ignore-plugin.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ title: WatchIgnorePlugin
33
contributors:
44
- skipjack
55
- byzyk
6+
- EugeneHlushko
67
---
78

89
Ignore the specified files, i.e. those matching the provided paths or regular expressions, while in [watch mode](/configuration/watch).
@@ -14,4 +15,4 @@ new webpack.WatchIgnorePlugin(paths);
1415

1516
## Options
1617

17-
- `paths` (array): A list of RegExps or absolute paths to directories or files that should be ignored
18+
- `paths` (`[string, RegExp]`): A list of RegExps or absolute paths to directories or files that should be ignored

0 commit comments

Comments
 (0)