Skip to content

Commit 66bbec8

Browse files
hai-xsnitin315
andauthored
docs(configuration): add entry[x].runtime (#7173)
Co-authored-by: Nitin Kumar <[email protected]>
1 parent 629ab2a commit 66bbec8

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

src/content/configuration/entry-context.mdx

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ contributors:
1111
- smelukov
1212
- anshumanv
1313
- snitin315
14+
- hai-x
1415
---
1516

1617
The entry object is where webpack looks to start building the bundle. The context is an absolute string to the directory that contains the entry files.
@@ -36,7 +37,7 @@ By default, the current working directory of Node.js is used, but it's recommend
3637

3738
## entry
3839

39-
`string` `[string]` `object = { <key> string | [string] | object = { import string | [string], dependOn string | [string], filename string, layer string }}` `(function() => string | [string] | object = { <key> string | [string] } | object = { import string | [string], dependOn string | [string], filename string })`
40+
`string` `[string]` `object = { <key> string | [string] | object = { import string | [string], dependOn string | [string], filename string, layer string, runtime string | false }}` `(function() => string | [string] | object = { <key> string | [string] } | object = { import string | [string], dependOn string | [string], filename string, layer string, runtime string | false })`
4041

4142
The point or points where to start the application bundling process. If an array is passed then all items will be processed.
4243

@@ -185,3 +186,25 @@ module.exports = {
185186
```
186187

187188
When combining with the [`output.library`](/configuration/output/#outputlibrary) option: If an array is passed only the last item is exported.
189+
190+
### Runtime chunk
191+
192+
It allows setting the runtime chunk for an entry point and setting it to `false` to avoid a new runtime chunk since webpack `v5.43.0`.
193+
194+
`optimization.runtimeChunk` allows setting it globally for unspecified entry points.
195+
196+
```js
197+
module.exports = {
198+
//...
199+
entry: {
200+
home: {
201+
import: './home.js',
202+
runtime: 'home-runtime',
203+
},
204+
about: {
205+
import: './about.js',
206+
runtime: false,
207+
},
208+
},
209+
};
210+
```

0 commit comments

Comments
 (0)