From f6572e3770a7ba7d6f0473cbbd348e04695f53fa Mon Sep 17 00:00:00 2001 From: anikethsaha Date: Wed, 12 Feb 2020 23:56:52 +0530 Subject: [PATCH 1/6] chore: documentated non extensiblity of hooks for v5 --- src/content/api/compilation-hooks.md | 2 ++ src/content/api/compiler-hooks.md | 5 ++++- src/content/api/parser.md | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/content/api/compilation-hooks.md b/src/content/api/compilation-hooks.md index 970121733655..46f34ec898dd 100644 --- a/src/content/api/compilation-hooks.md +++ b/src/content/api/compilation-hooks.md @@ -8,6 +8,7 @@ contributors: - misterdev - wizardofhogwarts - EugeneHlushko + - anikethsaha --- The `Compilation` module is used by the `Compiler` to create new compilations @@ -27,6 +28,7 @@ compilation.hooks.someHook.tap(/* ... */); As with the `compiler`, `tapAsync` and `tapPromise` may also be available depending on the type of hook. +W> Note that from __webpack@5__, `hooks` are no longer extensible. Use a `WeakMap` to add custom hooks. ### `buildModule` diff --git a/src/content/api/compiler-hooks.md b/src/content/api/compiler-hooks.md index c432b0c775b4..f9c4ff512a95 100644 --- a/src/content/api/compiler-hooks.md +++ b/src/content/api/compiler-hooks.md @@ -9,6 +9,7 @@ contributors: - misterdev - EugeneHlushko - superburrito + - anikethsaha --- The `Compiler` module is the main engine that creates a compilation instance @@ -23,6 +24,8 @@ for more information. When developing a plugin for webpack, you might want to know where each hook is called. To learn this, search for `hooks..call` across the webpack source +W> Note that from __webpack@5__, `hooks` are no longer extensible. Use a `WeakMap` to add custom hooks. + ## Watching The `Compiler` supports [watching](/api/node/#watching) which monitors the file @@ -252,7 +255,7 @@ Called after emitting assets to output directory. `AsyncSeriesHook` -Executed when an asset has been emitted. Provides access to information about the emitted asset, such as its output path and byte content. +Executed when an asset has been emitted. Provides access to information about the emitted asset, such as its output path and byte content. - Callback Parameters: `file`, `info` diff --git a/src/content/api/parser.md b/src/content/api/parser.md index 81cd5e4ae068..92377c887fd5 100644 --- a/src/content/api/parser.md +++ b/src/content/api/parser.md @@ -7,6 +7,7 @@ contributors: - DeTeam - misterdev - EugeneHlushko + - anikethsaha --- The `parser` instance, found in the `compiler`, is used to parse each module @@ -34,6 +35,7 @@ depending on the type of hook. The following lifecycle hooks are exposed by the `parser` and can be accessed as such: +W> Note that from __webpack@5__, `hooks` are no longer extensible. Use a `WeakMap` to add custom hooks. ### evaluateTypeof From 9956ad0dd3499fa11282992884fa84596ea7d20f Mon Sep 17 00:00:00 2001 From: anikethsaha Date: Thu, 13 Feb 2020 13:04:14 +0530 Subject: [PATCH 2/6] chore: changed to extendable --- src/content/api/compilation-hooks.md | 102 +++++---------------------- src/content/api/compiler-hooks.md | 35 ++------- src/content/api/parser.md | 2 +- 3 files changed, 23 insertions(+), 116 deletions(-) diff --git a/src/content/api/compilation-hooks.md b/src/content/api/compilation-hooks.md index 46f34ec898dd..8d6570b70cdb 100644 --- a/src/content/api/compilation-hooks.md +++ b/src/content/api/compilation-hooks.md @@ -21,14 +21,14 @@ hashed and restored. The `Compilation` class also extends `Tapable` and provides the following lifecycle hooks. They can be tapped the same way as compiler hooks: -``` js +```js compilation.hooks.someHook.tap(/* ... */); ``` As with the `compiler`, `tapAsync` and `tapPromise` may also be available depending on the type of hook. -W> Note that from __webpack@5__, `hooks` are no longer extensible. Use a `WeakMap` to add custom hooks. +W> Note that from **webpack@5**, `hooks` are no longer extendable. Use a `WeakMap` to add custom hooks. ### `buildModule` @@ -38,16 +38,15 @@ Triggered before a module build has started, can be used to modify the module. - Callback Parameters: `module` - ```js -compilation.hooks.buildModule.tap('SourceMapDevToolModuleOptionsPlugin', +compilation.hooks.buildModule.tap( + 'SourceMapDevToolModuleOptionsPlugin', module => { module.useSourceMap = true; } ); ``` - ### `rebuildModule` `SyncHook` @@ -56,7 +55,6 @@ Fired before rebuilding a module. - Callback Parameters: `module` - ### `failedModule` `SyncHook` @@ -65,7 +63,6 @@ Run when a module build has failed. - Callback Parameters: `module` `error` - ### `succeedModule` `SyncHook` @@ -74,7 +71,6 @@ Executed when a module has been built successfully. - Callback Parameters: `module` - ### `finishModules` `AsyncSeriesHook` @@ -83,7 +79,6 @@ Called when all modules have been built without errors. - Callback Parameters: `modules` - ### `finishRebuildingModule` `SyncHook` @@ -92,21 +87,18 @@ Executed when a module has been rebuilt, in case of both success or with errors. - Callback Parameters: `module` - ### `seal` `SyncHook` Fired when the compilation stops accepting new modules. - ### `unseal` `SyncHook` Fired when a compilation begins accepting new modules. - ### `optimizeDependenciesBasic` `SyncBailHook` @@ -115,7 +107,6 @@ W> This hook will be removed in v5.0.0 Parameters: `modules` - ### `optimizeDependencies` `SyncBailHook` @@ -124,7 +115,6 @@ Fired at the beginning of dependency optimization. - Callback Parameters: `modules` - ### `optimizeDependenciesAdvanced` `SyncBailHook` @@ -133,7 +123,6 @@ W> This hook will be removed in v5.0.0 - Callback Parameters: `modules` - ### `afterOptimizeDependencies` `SyncHook` @@ -142,14 +131,12 @@ Fired after the dependency optimization. - Callback Parameters: `modules` - ### `optimize` `SyncHook` Triggered at the beginning of the optimization phase. - ### `optimizeModulesBasic` `SyncBailHook` @@ -158,7 +145,6 @@ W> This hook will be removed in v5.0.0 - Callback Parameters: `modules` - ### `optimizeModules` `SyncBailHook` @@ -167,7 +153,6 @@ Called at the beginning of the module optimization phase. A plugin can tap into - Callback Parameters: `modules` - ### `optimizeModulesAdvanced` `SyncBailHook` @@ -176,7 +161,6 @@ W> This hook will be removed in v5.0.0 - Callback Parameters: `modules` - ### `afterOptimizeModules` `SyncHook` @@ -185,7 +169,6 @@ Called after modules optimization has completed. - Callback Parameters: `modules` - ### `optimizeChunksBasic` `SyncBailHook` @@ -194,7 +177,6 @@ W> This hook will be removed in v5.0.0 - Callback Parameters: `chunks` - ### `optimizeChunks` `SyncBailHook` @@ -203,7 +185,6 @@ Called at the beginning of the chunk optimization phase. A plugin can tap into t - Callback Parameters: `chunks` - ### `optimizeChunksAdvanced` `SyncBailHook` @@ -212,7 +193,6 @@ W> This hook will be removed in v5.0.0 - Callback Parameters: `chunks` - ### `afterOptimizeChunks` `SyncHook` @@ -221,7 +201,6 @@ Fired after chunk optimization has completed. - Callback Parameters: `chunks` - ### `optimizeTree` `AsyncSeriesHook` @@ -230,7 +209,6 @@ Called before optimizing the dependency tree. A plugin can tap into this hook to - Callback Parameters: `chunks` `modules` - ### `afterOptimizeTree` `SyncHook` @@ -239,7 +217,6 @@ Called after the dependency tree optimization has completed with success. - Callback Parameters: `chunks` `modules` - ### `optimizeChunkModulesBasic` `SyncBailHook` @@ -248,7 +225,6 @@ W> This hook will be removed in v5.0.0 - Callback Parameters: `chunks` `modules` - ### `optimizeChunkModules` `SyncBailHook` @@ -257,7 +233,6 @@ Called after the tree optimization, at the beginning of the chunk modules optimi - Callback Parameters: `chunks` `modules` - ### `optimizeChunkModulesAdvanced` `SyncBailHook` @@ -266,7 +241,6 @@ W> This hook will be removed in v5.0.0 - Callback Parameters: `chunks` `modules` - ### `afterOptimizeChunkModules` `SyncHook` @@ -275,14 +249,12 @@ Called after the chunkmodules optimization has completed successfully. - Callback Parameters: `chunks` `modules` - ### `shouldRecord` `SyncBailHook` Called to determine whether or not to store records. Returning anything `!== false` will prevent every other "record" hook from being executed ([`record`](#record), [`recordModules`](#recordmodules), [`recordChunks`](#recordchunks) and [`recordHash`](#recordhash)). - ### `reviveModules` `SyncHook` @@ -291,7 +263,6 @@ Restore module information from records. - Callback Parameters: `modules` `records` - ### `optimizeModuleOrder` `SyncHook` @@ -302,7 +273,6 @@ Sort the modules from most to least important. - Callback Parameters: `modules` - ### `advancedOptimizeModuleOrder` `SyncHook` @@ -311,7 +281,6 @@ W> This hook will be removed in v5.0.0 - Callback Parameters: `modules` - ### `beforeModuleIds` `SyncHook` @@ -320,7 +289,6 @@ Executed before assigning an `id` to each module. - Callback Parameters: `modules` - ### `moduleIds` `SyncHook` @@ -329,7 +297,6 @@ Called to assign an `id` to each module. - Callback Parameters: `modules` - ### `optimizeModuleIds` `SyncHook` @@ -338,7 +305,6 @@ Called at the beginning of the modules `id` optimization. - Callback Parameters: `modules` - ### `afterOptimizeModuleIds` `SyncHook` @@ -347,7 +313,6 @@ Called when the modules `id` optimization phase has completed. - Callback Parameters: `modules` - ### `reviveChunks` `SyncHook` @@ -356,7 +321,6 @@ Restore chunk information from records. - Callback Parameters: `chunks` `records` - ### `optimizeChunkOrder` `SyncHook` @@ -367,7 +331,6 @@ Sort the chunks in from most to least important. - Callback Parameters: `chunks` - ### `beforeChunkIds` `SyncHook` @@ -376,7 +339,6 @@ Executed before assigning an `id` to each chunk. - Callback Parameters: `chunks` - ### `chunkIds` `SyncHook` @@ -387,7 +349,6 @@ Called to assign an `id` to each chunk. - Callback Parameters: `modules` - ### `beforeOptimizeChunkIds` `SyncHook` @@ -398,7 +359,6 @@ Fired before chunks `id` optimization. - Callback Parameters: `chunks` - ### `optimizeChunkIds` `SyncHook` @@ -407,7 +367,6 @@ Called at the beginning of the chunks `id` optimization phase. - Callback Parameters: `chunks` - ### `afterOptimizeChunkIds` `SyncHook` @@ -416,7 +375,6 @@ Triggered after chunk `id` optimization has finished. - Callback Parameters: `chunks` - ### `recordModules` `SyncHook` @@ -425,7 +383,6 @@ Store module info to the records. This is triggered if [`shouldRecord`](#shouldr - Callback Parameters: `modules` `records` - ### `recordChunks` `SyncHook` @@ -434,7 +391,6 @@ Store chunk info to the records. This is only triggered if [`shouldRecord`](#sho - Callback Parameters: `chunks` `records` - ### `optimizeCodeGeneration` T> This hook will be available in v5.0.0 @@ -443,21 +399,18 @@ A plugin can tap into this hook to optimize the generated code. - Callback Parameters: `modules` - ### `beforeModuleHash` T> This hook will be available in v5.0.0 Called before hashing modules. - ### `afterModuleHash` T> This hook will be available in v5.0.0 Called after hashing modules. - ### `beforeRuntimeRequirements` T> This hook will be available in v5.0.0 @@ -466,28 +419,24 @@ Called before processing the modules required at runtime. - Callback Parameters: `entrypoints` - ### `afterRuntimeRequirements` T> This hook will be available in v5.0.0 Called after processing the runtime requirements. - ### `beforeHash` `SyncHook` Called before the compilation is hashed. - ### `afterHash` `SyncHook` Called after the compilation is hashed. - ### `recordHash` `SyncHook` @@ -496,7 +445,6 @@ Store information about record hash to the `records`. This is only triggered if - Callback Parameters: `records` - ### `record` `SyncHook` @@ -505,14 +453,12 @@ Store information about the `compilation` to the `records`. This is only trigger - Callback Parameters: `compilation` `records` - ### `beforeModuleAssets` `SyncHook` Executed before module assets creation. - ### `additionalChunkAssets` `SyncHook` @@ -521,22 +467,18 @@ Create additional assets for the chunks. - Callback Parameters: `chunks` - ### `shouldGenerateChunkAssets` `SyncBailHook` Called to determine whether or not generate chunks assets. Returning anything `!== false` will allow chunk assets generation. - ### `beforeChunkAssets` `SyncHook` Executed before creating the chunks assets. - - ### `additionalAssets` `AsyncSeriesHook` @@ -544,14 +486,16 @@ Executed before creating the chunks assets. Create additional assets for the compilation. This hook can be used to download an image, for example: -``` js +```js compilation.hooks.additionalAssets.tapAsync('MyPlugin', callback => { download('https://img.shields.io/npm/v/webpack.svg', function(resp) { - if(resp.status === 200) { + if (resp.status === 200) { compilation.assets['webpack-version.svg'] = toAsset(resp); callback(); } else { - callback(new Error('[webpack-example-plugin] Unable to download the image')); + callback( + new Error('[webpack-example-plugin] Unable to download the image') + ); } }); }); @@ -569,14 +513,14 @@ Any additional chunk assets are stored in `compilation.additionalChunkAssets`. Here's an example that simply adds a banner to each chunk. -``` js -compilation.hooks - .optimizeChunkAssets - .tapAsync('MyPlugin', (chunks, callback) => { +```js +compilation.hooks.optimizeChunkAssets.tapAsync( + 'MyPlugin', + (chunks, callback) => { chunks.forEach(chunk => { chunk.files.forEach(file => { compilation.assets[file] = new ConcatSource( - '\/**Sweet Banner**\/', + '/**Sweet Banner**/', '\n', compilation.assets[file] ); @@ -584,10 +528,10 @@ compilation.hooks }); callback(); - }); + } +); ``` - ### `afterOptimizeChunkAssets` `SyncHook` @@ -598,7 +542,7 @@ The chunk assets have been optimized. Here's an example plugin from [@boopathi](https://github.com/boopathi) that outputs exactly what went into each chunk. -``` js +```js compilation.hooks.afterOptimizeChunkAssets.tap('MyPlugin', chunks => { chunks.forEach(chunk => { console.log({ @@ -610,8 +554,6 @@ compilation.hooks.afterOptimizeChunkAssets.tap('MyPlugin', chunks => { }); ``` - - ### `optimizeAssets` `AsyncSeriesHook` @@ -620,7 +562,6 @@ Optimize all assets stored in `compilation.assets`. - Callback Parameters: `assets` - ### `afterOptimizeAssets` `SyncHook` @@ -629,21 +570,18 @@ The assets have been optimized. - Callback Parameters: `assets` - ### `needAdditionalSeal` `SyncBailHook` Called to determine if the compilation needs to be unsealed to include other files. - ### `afterSeal` `AsyncSeriesHook` Executed right after `needAdditionalSeal`. - ### `chunkHash` `SyncHook` @@ -652,7 +590,6 @@ Triggered to emit the hash for each chunk. - Callback Parameters: `chunk` `chunkHash` - ### `moduleAsset` `SyncHook` @@ -661,7 +598,6 @@ Called when an asset from a module was added to the compilation. - Callback Parameters: `module` `filename` - ### `chunkAsset` `SyncHook` @@ -670,7 +606,6 @@ Triggered when an asset from a chunk was added to the compilation. - Callback Parameters: `chunk` `filename` - ### `assetPath` `SyncWaterfallHook` @@ -679,14 +614,12 @@ Called to determine the path of an asset. - Callback Parameters: `path` `options` - ### `needAdditionalPass` `SyncBailHook` Called to determine if an asset needs to be processed further after being emitted. - ### `childCompiler` `SyncHook` @@ -695,7 +628,6 @@ Executed after setting up a child compiler. - Callback Parameters: `childCompiler` `compilerName` `compilerIndex` - ### `normalModuleLoader` Since webpack v5 `normalModuleLoader` hook was removed. Now to access the loader use `NormalModule.getCompilationHooks(compilation).loader` instead. diff --git a/src/content/api/compiler-hooks.md b/src/content/api/compiler-hooks.md index f9c4ff512a95..cc4cd48e61b8 100644 --- a/src/content/api/compiler-hooks.md +++ b/src/content/api/compiler-hooks.md @@ -23,8 +23,7 @@ for more information. When developing a plugin for webpack, you might want to know where each hook is called. To learn this, search for `hooks..call` across the webpack source - -W> Note that from __webpack@5__, `hooks` are no longer extensible. Use a `WeakMap` to add custom hooks. +W> Note that from **webpack@5**, `hooks` are no longer extendable. Use a `WeakMap` to add custom hooks. ## Watching @@ -36,14 +35,13 @@ the hood of tools like `webpack-dev-server`, so that the developer doesn't need to re-compile manually every time. Watch mode can also be entered via the [CLI](/api/cli/#watch-options). - ## Hooks The following lifecycle hooks are exposed by the `compiler` and can be accessed as such: -``` js -compiler.hooks.someHook.tap('MyPlugin', (params) => { +```js +compiler.hooks.someHook.tap('MyPlugin', params => { /* ... */ }); ``` @@ -52,7 +50,6 @@ Depending on the hook type, `tapAsync` and `tapPromise` may also be available. For the description of hook types, see [the Tapable docs](https://github.com/webpack/tapable#tapable). - ### `entryOption` `SyncBailHook` @@ -77,7 +74,6 @@ Called after setting up initial set of internal plugins. - Callback Parameters: `compiler` - ### `afterResolvers` `SyncHook` @@ -86,21 +82,18 @@ Triggered after resolver setup is complete. - Callback Parameters: `compiler` - ### `environment` `SyncHook` Called while preparing the compiler environment, right after inizializing the plugins in the configuration file. - ### `afterEnvironment` `SyncHook` Called right after the `environment` hook, when the compiler environment setup is complete. - ### `beforeRun` `AsyncSeriesHook` @@ -109,7 +102,6 @@ Adds a hook right before running the compiler. - Callback Parameters: `compiler` - ### `run` `AsyncSeriesHook` @@ -118,7 +110,6 @@ Hook into the compiler before it begins reading [`records`](/configuration/other - Callback Parameters: `compiler` - ### `watchRun` `AsyncSeriesHook` @@ -127,7 +118,6 @@ Executes a plugin during watch mode after a new compilation is triggered but bef - Callback Parameters: `compiler` - ### `normalModuleFactory` `SyncHook` @@ -136,7 +126,6 @@ Called after a `NormalModuleFactory` is created. - Callback Parameters: `normalModuleFactory` - ### `contextModuleFactory` `SyncHook` @@ -145,7 +134,6 @@ Runs a plugin after a `ContextModuleFactory` is created. - Callback Parameters: `contextModuleFactory` - ### `beforeCompile` `AsyncSeriesHook` @@ -159,7 +147,7 @@ The `compilationParams` variable is initialized as follows: ```js compilationParams = { normalModuleFactory, - contextModuleFactory, + contextModuleFactory }; ``` @@ -172,7 +160,6 @@ compiler.hooks.beforeCompile.tapAsync('MyPlugin', (params, callback) => { }); ``` - ### `compile` `SyncHook` @@ -181,7 +168,6 @@ Called right after `beforeCompile`, before a new compilation is created. - Callback Parameters: `compilationParams` - ### `thisCompilation` `SyncHook` @@ -190,7 +176,6 @@ Executed while initializing the compilation, right before emitting the `compilat - Callback Parameters: `compilation`, `compilationParams` - ### `compilation` `SyncHook` @@ -199,7 +184,6 @@ Runs a plugin after a compilation has been created. - Callback Parameters: `compilation`, `compilationParams` - ### `make` `AsyncParallelHook` @@ -208,7 +192,6 @@ Executed before finishing the compilation. - Callback Parameters: `compilation` - ### `afterCompile` `AsyncSeriesHook` @@ -217,7 +200,6 @@ Called after finishing and sealing the compilation. - Callback Parameters: `compilation` - ### `shouldEmit` `SyncBailHook` @@ -227,13 +209,12 @@ Called before emitting assets. Should return a boolean telling whether to emit. - Callback Parameters: `compilation` ```js -compiler.hooks.shouldEmit.tap('MyPlugin', (compilation) => { +compiler.hooks.shouldEmit.tap('MyPlugin', compilation => { // return true to emit the output, otherwise false return true; }); ``` - ### `emit` `AsyncSeriesHook` @@ -242,7 +223,6 @@ Executed right before emitting assets to output dir. - Callback Parameters: `compilation` - ### `afterEmit` `AsyncSeriesHook` @@ -270,7 +250,6 @@ compiler.hooks.assetEmitted.tap( ); ``` - ### `done` `AsyncSeriesHook` @@ -279,7 +258,6 @@ Executed when the compilation has completed. - Callback Parameters: `stats` - ### `failed` `SyncHook` @@ -288,7 +266,6 @@ Called if the compilation fails. - Callback Parameters: `error` - ### `invalid` `SyncHook` @@ -297,7 +274,6 @@ Executed when a watching compilation has been invalidated. - Callback Parameters: `fileName`, `changeTime` - ### `watchClose` `SyncHook` @@ -312,7 +288,6 @@ Allows to use infrastructure logging when enabled in the configuration via [`inf - Callback Parameters: `name`, `type`, `args` - ### `log` `SyncBailHook` diff --git a/src/content/api/parser.md b/src/content/api/parser.md index 92377c887fd5..5bcc8e207676 100644 --- a/src/content/api/parser.md +++ b/src/content/api/parser.md @@ -35,7 +35,7 @@ depending on the type of hook. The following lifecycle hooks are exposed by the `parser` and can be accessed as such: -W> Note that from __webpack@5__, `hooks` are no longer extensible. Use a `WeakMap` to add custom hooks. +W> Note that from __webpack@5__, `hooks` are no longer extendable. Use a `WeakMap` to add custom hooks. ### evaluateTypeof From 2aab196024dc273f1ded019e432a64d67bd10505 Mon Sep 17 00:00:00 2001 From: anikethsaha Date: Thu, 13 Feb 2020 13:19:27 +0530 Subject: [PATCH 3/6] chore: linting fixes --- src/content/api/compilation-hooks.md | 4 ++-- src/content/api/compiler-hooks.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/content/api/compilation-hooks.md b/src/content/api/compilation-hooks.md index 8d6570b70cdb..103a1881d93f 100644 --- a/src/content/api/compilation-hooks.md +++ b/src/content/api/compilation-hooks.md @@ -28,7 +28,7 @@ compilation.hooks.someHook.tap(/* ... */); As with the `compiler`, `tapAsync` and `tapPromise` may also be available depending on the type of hook. -W> Note that from **webpack@5**, `hooks` are no longer extendable. Use a `WeakMap` to add custom hooks. +W> Note that from __webpack@5__, `hooks` are no longer extendable. Use a `WeakMap` to add custom hooks. ### `buildModule` @@ -520,7 +520,7 @@ compilation.hooks.optimizeChunkAssets.tapAsync( chunks.forEach(chunk => { chunk.files.forEach(file => { compilation.assets[file] = new ConcatSource( - '/**Sweet Banner**/', + '/__Sweet Banner__/', '\n', compilation.assets[file] ); diff --git a/src/content/api/compiler-hooks.md b/src/content/api/compiler-hooks.md index cc4cd48e61b8..efb59c02523e 100644 --- a/src/content/api/compiler-hooks.md +++ b/src/content/api/compiler-hooks.md @@ -23,7 +23,7 @@ for more information. When developing a plugin for webpack, you might want to know where each hook is called. To learn this, search for `hooks..call` across the webpack source -W> Note that from **webpack@5**, `hooks` are no longer extendable. Use a `WeakMap` to add custom hooks. +W> Note that from __webpack@5__, `hooks` are no longer extendable. Use a `WeakMap` to add custom hooks. ## Watching From 3f35584aaa0dcc6d3c162ff3412af284dc130fba Mon Sep 17 00:00:00 2001 From: Anix Date: Sun, 16 Feb 2020 20:04:41 +0530 Subject: [PATCH 4/6] Update src/content/api/compilation-hooks.md Co-Authored-By: Eugene Hlushko --- src/content/api/compilation-hooks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/api/compilation-hooks.md b/src/content/api/compilation-hooks.md index 103a1881d93f..ee801fdefd58 100644 --- a/src/content/api/compilation-hooks.md +++ b/src/content/api/compilation-hooks.md @@ -28,7 +28,7 @@ compilation.hooks.someHook.tap(/* ... */); As with the `compiler`, `tapAsync` and `tapPromise` may also be available depending on the type of hook. -W> Note that from __webpack@5__, `hooks` are no longer extendable. Use a `WeakMap` to add custom hooks. +W> Since webpack 5, `hooks` are no longer extendable. Use a `WeakMap` to add custom hooks. ### `buildModule` From 69c22e9421c52e4b4e65e0ae6f202630c1225e0a Mon Sep 17 00:00:00 2001 From: Anix Date: Sun, 16 Feb 2020 20:04:52 +0530 Subject: [PATCH 5/6] Update src/content/api/compiler-hooks.md Co-Authored-By: Eugene Hlushko --- src/content/api/compiler-hooks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/api/compiler-hooks.md b/src/content/api/compiler-hooks.md index efb59c02523e..7fe3115fd3da 100644 --- a/src/content/api/compiler-hooks.md +++ b/src/content/api/compiler-hooks.md @@ -23,7 +23,7 @@ for more information. When developing a plugin for webpack, you might want to know where each hook is called. To learn this, search for `hooks..call` across the webpack source -W> Note that from __webpack@5__, `hooks` are no longer extendable. Use a `WeakMap` to add custom hooks. +W> Since webpack 5, `hooks` are no longer extendable. Use a `WeakMap` to add custom hooks. ## Watching From 6749de8e78dab2218c27b0dcac424ab5551a22e4 Mon Sep 17 00:00:00 2001 From: Anix Date: Sun, 16 Feb 2020 20:05:06 +0530 Subject: [PATCH 6/6] Update src/content/api/parser.md Co-Authored-By: Eugene Hlushko --- src/content/api/parser.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/api/parser.md b/src/content/api/parser.md index 5bcc8e207676..672f673906e5 100644 --- a/src/content/api/parser.md +++ b/src/content/api/parser.md @@ -35,7 +35,7 @@ depending on the type of hook. The following lifecycle hooks are exposed by the `parser` and can be accessed as such: -W> Note that from __webpack@5__, `hooks` are no longer extendable. Use a `WeakMap` to add custom hooks. +W> Since webpack 5, `hooks` are no longer extendable. Use a `WeakMap` to add custom hooks. ### evaluateTypeof