@@ -181,31 +181,51 @@ module.exports = {
181
181
Compile entrypoints and dynamic ` import ` s only when they are in use. It can be used for either Web or Node.js.
182
182
183
183
- Type
184
+
184
185
- ` boolean `
185
186
- ` object `
187
+
186
188
``` ts
187
189
{
188
- // define a custom backend
189
- backend ?: ((
190
- compiler : webpack .Compiler ,
191
- client : string ,
192
- callback : (err ? : Error , api ? : any ) => void
190
+ // define a custom backend
191
+ backend ?: ((
192
+ compiler : Compiler ,
193
+ callback : (err ? : Error , api ? : BackendApi ) => void
193
194
) => void )
194
- | ((
195
- compiler : webpack .Compiler ,
196
- client : string
197
- ) => Promise < any > )
198
- client ?: string ,
199
- entries ?: boolean ,
200
- imports ?: boolean ,
201
- test ?: RegExp | string | ((module : import (" ../lib/Module" )) => boolean )
195
+ | ((compiler : Compiler ) => Promise < BackendApi > )
196
+ | {
197
+ /**
198
+ * A custom client.
199
+ */
200
+ client ?: string ;
201
+
202
+ /**
203
+ * Specify where to listen to from the server.
204
+ */
205
+ listen ?: number | ListenOptions | ((server : typeof Server ) => void );
206
+
207
+ /**
208
+ * Specify the protocol the client should use to connect to the server.
209
+ */
210
+ protocol ?: " http" | " https" ;
211
+
212
+ /**
213
+ * Specify how to create the server handling the EventSource requests.
214
+ */
215
+ server ?: ServerOptionsImport | ServerOptionsHttps | (() => typeof Server );
216
+
217
+ },
218
+ entries ?: boolean ,
219
+ imports ?: boolean ,
220
+ test ?: string | RegExp | ((module : Module ) => boolean )
202
221
}
203
222
```
204
- - ` client ` : Path to a custom client, defaults to ` webpack/hot/lazy-compilation-{node|web}.js ` .
205
- - ` backend ` : Customize the backend, defaults to ` webpack/lib/hmr/lazyCompilationBackend ` .
223
+
224
+ - ` backend ` : Customize the backend.
206
225
- ` entries ` : Enable lazy compilation for entries.
207
226
- ` imports ` <Badge text = ' 5.20.0+' />: Enable lazy compilation for dynamic imports.
208
227
- ` test ` <Badge text = ' 5.20.0+' />: Specify which imported modules should be lazily compiled.
228
+
209
229
- Available: 5.17.0+
210
230
- Example 1:
211
231
``` js
0 commit comments