Skip to content

Commit

Permalink
Add entry[x].runtime configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
hai-x committed Mar 7, 2024
1 parent 8a0f1dc commit 5adccf4
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion src/content/configuration/entry-context.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ contributors:
- smelukov
- anshumanv
- snitin315
- hai-x
---

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.
Expand All @@ -36,7 +37,7 @@ By default, the current working directory of Node.js is used, but it's recommend

## entry

`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 })`
`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 })`

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

Expand Down Expand Up @@ -185,3 +186,25 @@ module.exports = {
```

When combining with the [`output.library`](/configuration/output/#outputlibrary) option: If an array is passed only the last item is exported.

### Runtime chunk

It allows to set the runtime chunk for an entrypoint and it can be set to `false` to avoid a new runtime chunk since webpack 5.43.0.

`optimization.runtimeChunk` allows to set it globally for unspecified entrypoints.

```js
module.exports = {
//...
entry: {
home: {
import: './home.js',
runtime: 'home-runtime',
},
about: {
import: './about.js',
runtime: false,
},
},
};
```

0 comments on commit 5adccf4

Please sign in to comment.