diff --git a/src/content/configuration/output.md b/src/content/configuration/output.md index 50429ef90120..35ea16414064 100644 --- a/src/content/configuration/output.md +++ b/src/content/configuration/output.md @@ -87,7 +87,7 @@ module.exports = { ## `output.chunkFilename` -`string` +`string = '[id].js'` This option determines the name of non-entry chunk files. See [`output.filename`](#outputfilename) option for details on the possible values. @@ -95,12 +95,36 @@ Note that these filenames need to be generated at runtime to send the requests f By default `[id].js` is used or a value inferred from [`output.filename`](#outputfilename) (`[name]` is replaced with `[id]` or `[id].` is prepended). +__webpack.config.js__ + +```javascript +module.exports = { + //... + output: { + //... + chunkFilename: '[id].js' + } +}; +``` + ## `output.chunkLoadTimeout` -`number` +`number = 120000` -Number of milliseconds before chunk request expires, defaults to 120 000. This option is supported since webpack 2.6.0. +Number of milliseconds before chunk request expires. This option is supported since webpack 2.6.0. + +__webpack.config.js__ + +```javascript +module.exports = { + //... + output: { + //... + chunkLoadTimeout: 30000 + } +}; +``` ## `output.crossOriginLoading` diff --git a/src/content/plugins/progress-plugin.md b/src/content/plugins/progress-plugin.md index a8a0115f9e94..ca7ae2ddd134 100644 --- a/src/content/plugins/progress-plugin.md +++ b/src/content/plugins/progress-plugin.md @@ -6,7 +6,10 @@ contributors: - byzyk --- -`object` `function (percentage: number, message: string, ...args: string[])` +` +object = { boolean activeModules = true, boolean entries = false, function (number percentage, string message, [string] ...args) handler, boolean modules = true, number modulesCount = 500, boolean profile = false }` + +`function (number percentage, string message, [string] ...args)` The `ProgressPlugin` provides a way to customize how progress is reported during a compilation. @@ -15,7 +18,7 @@ The `ProgressPlugin` provides a way to customize how progress is reported during Create an instance of `ProgressPlugin` and provide one of the allowed params. ### Providing `function` - + Provide a handler function which will be called when hooks report progress. `handler` function arguments: - `percentage`: a number between 0 and 1 indicating the completion percentage of the compilation @@ -36,12 +39,12 @@ new webpack.ProgressPlugin(handler); When providing an `object` to the `ProgressPlugin`, following properties are supported: -- `activeModules: boolean = true` show's active modules count and one active module in progress message -- `entries: boolean = false` show's entries count in progress message -- [`handler: function(percentage, message, ...args)`](#providing-function) -- `modules: boolean = true` show's modules count in progress message -- `modulesCount: number = 500` a minimum modules count to start with. Takes effect when `modules` property is enabled. -- `profile: true | false | null = false` tells `ProgressPlugin` to collect profile data for progress steps. +- `activeModules` show's active modules count and one active module in progress message +- `entries` show's entries count in progress message +- [`handler: function (percentage, message, ...args)`](#providing-function) +- `modules` show's modules count in progress message +- `modulesCount` a minimum modules count to start with. Takes effect when `modules` property is enabled. +- `profile` tells `ProgressPlugin` to collect profile data for progress steps. ```js diff --git a/src/content/plugins/source-map-dev-tool-plugin.md b/src/content/plugins/source-map-dev-tool-plugin.md index 05826a20112c..710b093734f9 100644 --- a/src/content/plugins/source-map-dev-tool-plugin.md +++ b/src/content/plugins/source-map-dev-tool-plugin.md @@ -5,6 +5,7 @@ contributors: - simon04 - neilkennedy - byzyk + - EugeneHlushko related: - title: Building Source Maps url: https://survivejs.com/webpack/building/source-maps/#-sourcemapdevtoolplugin-and-evalsourcemapdevtoolplugin- @@ -21,18 +22,18 @@ new webpack.SourceMapDevToolPlugin(options); The following options are supported: -- `test` (`string|regex|array`): Include source maps for modules based on their extension (defaults to `.js`, `.mjs`, and `.css`). -- `include` (`string|regex|array`): Include source maps for module paths that match the given value. -- `exclude` (`string|regex|array`): Exclude modules that match the given value from source map generation. +- `test` (`string` `RegExp` `[string, RegExp]`): Include source maps for modules based on their extension (defaults to `.js`, `.mjs`, and `.css`). +- `include` (`string` `RegExp` `[string, RegExp]`): Include source maps for module paths that match the given value. +- `exclude` (`string` `RegExp` `[string, RegExp]`): Exclude modules that match the given value from source map generation. - `filename` (`string`): Defines the output filename of the SourceMap (will be inlined if no value is provided). - `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. - `moduleFilenameTemplate` (`string`): See [`output.devtoolModuleFilenameTemplate`](/configuration/output/#outputdevtoolmodulefilenametemplate). - `fallbackModuleFilenameTemplate` (`string`): See link above. - `namespace` (`string`): See [`output.devtoolNamespace`](/configuration/output/#outputdevtoolnamespace). -- `module` (`boolean`): Indicates whether loaders should generate source maps (defaults to `true`). -- `columns` (`boolean`): Indicates whether column mappings should be used (defaults to `true`). -- `lineToLine` (`boolean` or `object`): Simplify and speed up source mapping by using line to line source mappings for matched modules. -- `noSources` (`boolean`): Prevents the source file content from being included in the source map (defaults to `false`). +- `module = true` (`boolean`): Indicates whether loaders should generate source maps. +- `columns = true` (`boolean`): Indicates whether column mappings should be used. +- `lineToLine` (`boolean` `object`): Simplify and speed up source mapping by using line to line source mappings for matched modules. +- `noSources = false` (`boolean`): Prevents the source file content from being included in the source map. - `publicPath` (`string`): Emits absolute URLs with public path prefix, e.g. `https://example.com/project/`. - `fileContext` (`string`): Makes the `[file]` argument relative to this directory. diff --git a/src/content/plugins/split-chunks-plugin.md b/src/content/plugins/split-chunks-plugin.md index fe235824a4cc..f3de8a22b211 100644 --- a/src/content/plugins/split-chunks-plugin.md +++ b/src/content/plugins/split-chunks-plugin.md @@ -89,13 +89,13 @@ By default webpack will generate names using origin and name of the chunk (e.g. ### `splitChunks.automaticNameMaxLength` -`number: 109` +`number = 109` Allows setting a maximum character count for chunk names that are generated by the `SplitChunksPlugin`. ### `splitChunks.chunks` -`function (chunk) | string` +`function (chunk)` `string` 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. @@ -170,7 +170,7 @@ T> `maxSize` takes higher priority than `maxInitialRequest/maxAsyncRequests`. Ac ### `splitChunks.name` -`boolean: true | function (module, chunks, cacheGroupKey):string | string` +`boolean = true` `function (module, chunks, cacheGroupKey) => string` `string` Also available for each cacheGroup: `splitChunks.cacheGroups.{cacheGroup}.name`. @@ -270,7 +270,7 @@ module.exports = { #### `splitChunks.cacheGroups.{cacheGroup}.test` -`function (module, chunk):boolean | RegExp | string` +`function (module, chunk) => boolean` `RegExp` `string` 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. @@ -322,7 +322,7 @@ module.exports = { #### `splitChunks.cacheGroups.{cacheGroup}.enforce` -`boolean: false` +`boolean = false` 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. diff --git a/src/content/plugins/watch-ignore-plugin.md b/src/content/plugins/watch-ignore-plugin.md index 81a817da6016..6bbf5895ea90 100644 --- a/src/content/plugins/watch-ignore-plugin.md +++ b/src/content/plugins/watch-ignore-plugin.md @@ -3,6 +3,7 @@ title: WatchIgnorePlugin contributors: - skipjack - byzyk + - EugeneHlushko --- 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); ## Options -- `paths` (array): A list of RegExps or absolute paths to directories or files that should be ignored +- `paths` (`[string, RegExp]`): A list of RegExps or absolute paths to directories or files that should be ignored