Skip to content

Commit bf85ef6

Browse files
snitin315chenxsan
andauthored
docs: avoid code in heading (#5297)
* docs(configuration): avoid code in heading * docs(api): avoide code in heading * docs(concepts): avoid code in heading * docs(configuration): avoid code in heading * docs(guides): avoid code in heading * docs(migrate): avoid code in heading * docs(plugins): avoid code in heading * fix: ci * docs: avoid code in heading * fix: ci * docs: fix * Apply suggestions from code review Co-authored-by: Sam Chen <chenxsan@gmail.com> Co-authored-by: Sam Chen <chenxsan@gmail.com>
1 parent 786b9d9 commit bf85ef6

28 files changed

+377
-376
lines changed

src/content/api/compilation-hooks.mdx

Lines changed: 58 additions & 58 deletions
Large diffs are not rendered by default.

src/content/api/compiler-hooks.mdx

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,19 @@ Depending on the hook type, `tapAsync` and `tapPromise` may also be available.
4444

4545
For the description of hook types, see [the Tapable docs](https://github.com/webpack/tapable#tapable).
4646

47-
### `environment`
47+
### environment
4848

4949
`SyncHook`
5050

5151
Called while preparing the compiler environment, right after initializing the plugins in the configuration file.
5252

53-
### `afterEnvironment`
53+
### afterEnvironment
5454

5555
`SyncHook`
5656

5757
Called right after the `environment` hook, when the compiler environment setup is complete.
5858

59-
### `entryOption`
59+
### entryOption
6060

6161
`SyncBailHook`
6262

@@ -70,69 +70,69 @@ compiler.hooks.entryOption.tap('MyPlugin', (context, entry) => {
7070
});
7171
```
7272

73-
### `afterPlugins`
73+
### afterPlugins
7474

7575
`SyncHook`
7676

7777
Called after setting up initial set of internal plugins.
7878

7979
- Callback Parameters: `compiler`
8080

81-
### `afterResolvers`
81+
### afterResolvers
8282

8383
`SyncHook`
8484

8585
Triggered after resolver setup is complete.
8686

8787
- Callback Parameters: `compiler`
8888

89-
### `initialize`
89+
### initialize
9090

9191
`SyncHook`
9292

9393
Called when a compiler object is initialized.
9494

95-
### `beforeRun`
95+
### beforeRun
9696

9797
`AsyncSeriesHook`
9898

9999
Adds a hook right before running the compiler.
100100

101101
- Callback Parameters: `compiler`
102102

103-
### `run`
103+
### run
104104

105105
`AsyncSeriesHook`
106106

107107
Hook into the compiler before it begins reading [`records`](/configuration/other-options/#recordspath).
108108

109109
- Callback Parameters: `compiler`
110110

111-
### `watchRun`
111+
### watchRun
112112

113113
`AsyncSeriesHook`
114114

115115
Executes a plugin during watch mode after a new compilation is triggered but before the compilation is actually started.
116116

117117
- Callback Parameters: `compiler`
118118

119-
### `normalModuleFactory`
119+
### normalModuleFactory
120120

121121
`SyncHook`
122122

123123
Called after a [NormalModuleFactory](/api/normalmodulefactory-hooks) is created.
124124

125125
- Callback Parameters: `normalModuleFactory`
126126

127-
### `contextModuleFactory`
127+
### contextModuleFactory
128128

129129
`SyncHook`
130130

131131
Runs a plugin after a [ContextModuleFactory](/api/contextmodulefactory-hooks) is created.
132132

133133
- Callback Parameters: `contextModuleFactory`
134134

135-
### `beforeCompile`
135+
### beforeCompile
136136

137137
`AsyncSeriesHook`
138138

@@ -158,47 +158,47 @@ compiler.hooks.beforeCompile.tapAsync('MyPlugin', (params, callback) => {
158158
});
159159
```
160160

161-
### `compile`
161+
### compile
162162

163163
`SyncHook`
164164

165165
Called right after `beforeCompile`, before a new compilation is created.
166166

167167
- Callback Parameters: `compilationParams`
168168

169-
### `thisCompilation`
169+
### thisCompilation
170170

171171
`SyncHook`
172172

173173
Executed while initializing the compilation, right before emitting the `compilation` event.
174174

175175
- Callback Parameters: `compilation`, `compilationParams`
176176

177-
### `compilation`
177+
### compilation
178178

179179
`SyncHook`
180180

181181
Runs a plugin after a compilation has been created.
182182

183183
- Callback Parameters: `compilation`, `compilationParams`
184184

185-
### `make`
185+
### make
186186

187187
`AsyncParallelHook`
188188

189189
Executed before finishing the compilation.
190190

191191
- Callback Parameters: `compilation`
192192

193-
### `afterCompile`
193+
### afterCompile
194194

195195
`AsyncSeriesHook`
196196

197197
Called after finishing and sealing the compilation.
198198

199199
- Callback Parameters: `compilation`
200200

201-
### `shouldEmit`
201+
### shouldEmit
202202

203203
`SyncBailHook`
204204

@@ -213,23 +213,23 @@ compiler.hooks.shouldEmit.tap('MyPlugin', (compilation) => {
213213
});
214214
```
215215

216-
### `emit`
216+
### emit
217217

218218
`AsyncSeriesHook`
219219

220220
Executed right before emitting assets to output dir.
221221

222222
- Callback Parameters: `compilation`
223223

224-
### `afterEmit`
224+
### afterEmit
225225

226226
`AsyncSeriesHook`
227227

228228
Called after emitting assets to output directory.
229229

230230
- Callback Parameters: `compilation`
231231

232-
### `assetEmitted`
232+
### assetEmitted
233233

234234
`AsyncSeriesHook`
235235

@@ -248,51 +248,51 @@ compiler.hooks.assetEmitted.tap(
248248
);
249249
```
250250

251-
### `done`
251+
### done
252252

253253
`AsyncSeriesHook`
254254

255255
Executed when the compilation has completed.
256256

257257
- Callback Parameters: `stats`
258258

259-
### `additionalPass`
259+
### additionalPass
260260

261261
`AsyncSeriesHook`
262262

263263
This hook allows you to do a one more additional pass of the build.
264264

265-
### `failed`
265+
### failed
266266

267267
`SyncHook`
268268

269269
Called if the compilation fails.
270270

271271
- Callback Parameters: `error`
272272

273-
### `invalid`
273+
### invalid
274274

275275
`SyncHook`
276276

277277
Executed when a watching compilation has been invalidated.
278278

279279
- Callback Parameters: `fileName`, `changeTime`
280280

281-
### `watchClose`
281+
### watchClose
282282

283283
`SyncHook`
284284

285285
Called when a watching compilation has stopped.
286286

287-
### `infrastructureLog`
287+
### infrastructureLog
288288

289289
`SyncBailHook`
290290

291291
Allows to use infrastructure logging when enabled in the configuration via [`infrastructureLogging` option](/configuration/other-options/#infrastructurelogging).
292292

293293
- Callback Parameters: `name`, `type`, `args`
294294

295-
### `log`
295+
### log
296296

297297
`SyncBailHook`
298298

src/content/api/hot-module-replacement.mdx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ The following methods are supported...
3838
3939
## Module API
4040
41-
### `accept`
41+
### accept
4242
4343
Accept updates for the given `dependencies` and fire a `callback` to react to those updates, in addition, you can attach an optional error handler:
4444
@@ -69,7 +69,7 @@ When using CommonJS you need to update dependencies manually by using `require()
6969
- `moduleId`: the current module id.
7070
- `dependencyId`: the module id of the (first) changed dependency.
7171

72-
### `accept` (self)
72+
### accept (self)
7373

7474
Accept updates for itself.
7575

@@ -98,7 +98,7 @@ The `errorHandler` is fired when the evaluation of this module (or dependencies)
9898
- `module.hot`: allow to use the HMR API of the errored module instance. A common scenario is to self accept it again. It also makes sense to add a dispose handler to pass data along. Note that the errored module might be already partially executed, so make sure to not get into a inconsistent state. You can use `module.hot.data` to store partial state.
9999
- `module.exports`: can be overridden, but be careful since property names might be mangled in production mode.
100100

101-
### `decline`
101+
### decline
102102

103103
Reject updates for the given `dependencies` forcing the update to fail with a `'decline'` code.
104104

@@ -115,7 +115,7 @@ import.meta.webpackHot.decline(
115115

116116
Flag a dependency as not-update-able. This makes sense when changing exports of this dependency can't be handled or handling is not implemented yet. Depending on your HMR management code, an update to these dependencies (or unaccepted dependencies of it) usually causes a full-reload of the page.
117117

118-
### `decline` (self)
118+
### decline (self)
119119

120120
Reject updates for itself.
121121

@@ -128,7 +128,7 @@ import.meta.webpackHot.decline();
128128

129129
Flag this module as not-update-able. This makes sense when this module has irreversible side-effects, or HMR handling is not implemented for this module yet. Depending on your HMR management code, an update to this module (or unaccepted dependencies) usually causes a full-reload of the page.
130130

131-
### `dispose` (or `addDisposeHandler`)
131+
### dispose (or addDisposeHandler)
132132

133133
Add a handler which is executed when the current module code is replaced. This should be used to remove any persistent resource you have claimed or created. If you want to transfer state to the updated module, add it to the given `data` parameter. This object will be available at `module.hot.data` after the update.
134134

@@ -143,7 +143,7 @@ import.meta.webpackHot.dispose((data) => {
143143
});
144144
```
145145

146-
### `invalidate`
146+
### invalidate
147147

148148
Calling this method will invalidate the current module, which disposes and recreates it when the HMR update is applied. This bubbles like a normal update of this module. `invalidate` can't be self-accepted by this module.
149149

@@ -220,7 +220,7 @@ T> When `invalidate` is called, the [`dispose`](#dispose-or-adddisposehandler) h
220220

221221
W> Do not get caught in an `invalidate` loop, by calling `invalidate` again and again. This will result in stack overflow and HMR entering the `fail` state.
222222

223-
### `removeDisposeHandler`
223+
### removeDisposeHandler
224224

225225
Remove the handler added via `dispose` or `addDisposeHandler`.
226226

@@ -233,7 +233,7 @@ import.meta.webpackHot.removeDisposeHandler(callback);
233233

234234
## Management API
235235

236-
### `status`
236+
### status
237237

238238
Retrieve the current status of the hot module replacement process.
239239

@@ -255,7 +255,7 @@ import.meta.webpackHot.status();
255255
| abort | An update was aborted, but the system is still in its previous state |
256256
| fail | An update has thrown an exception and the system's state has been compromised |
257257

258-
### `check`
258+
### check
259259

260260
Test all loaded modules for updates and, if updates exist, `apply` them.
261261

@@ -282,7 +282,7 @@ import.meta.webpackHot
282282

283283
The `autoApply` parameter can either be a boolean or `options` to pass to the `apply` method when called.
284284

285-
### `apply`
285+
### apply
286286

287287
Continue the update process (as long as `module.hot.status() === 'ready'`).
288288

@@ -340,7 +340,7 @@ The `info` parameter will be an object containing some of the following values:
340340
}
341341
```
342342

343-
### `addStatusHandler`
343+
### addStatusHandler
344344

345345
Register a function to listen for changes in `status`.
346346

@@ -357,7 +357,7 @@ import.meta.webpackHot.addStatusHandler((status) => {
357357

358358
Bear in mind that when the status handler returns a `Promise`, the HMR system will wait for the `Promise` to resolve before continuing.
359359

360-
### `removeStatusHandler`
360+
### removeStatusHandler
361361

362362
Remove a registered status handler.
363363

0 commit comments

Comments
 (0)