Skip to content

Commit 771f29b

Browse files
authored
docs(configuration): update dependOn option (#4246)
* docs(config): update dependOn option * fix lint
1 parent a8b8218 commit 771f29b

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

src/content/configuration/entry-context.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ contributors:
1010
- EugeneHlushko
1111
- smelukov
1212
- anshumanv
13+
- snitin315
1314
---
1415

1516
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.
@@ -109,7 +110,7 @@ Descriptor syntax was used here to pass `filename`-option to the specific entry
109110

110111
### Dependencies
111112

112-
By default, every entry chunk stores all the modules that it uses. With `dependOn`-option you can share the modules from one entry chunk to another:
113+
By default, every entry chunk stores all the modules that it uses. With `dependOn` option you can share the modules from one entry chunk to another:
113114

114115
```js
115116
module.exports = {
@@ -123,7 +124,23 @@ module.exports = {
123124

124125
The `app` chunk will not contain the modules that `react-vendors` has.
125126

126-
Also you can specify multiple files per entry using array:
127+
`dependOn` option can also accept an array of strings:
128+
129+
```js
130+
module.exports = {
131+
//...
132+
entry: {
133+
moment: { import: 'moment-mini', runtime: 'runtime' },
134+
reactvendors: { import: ['react', 'react-dom'], runtime: 'runtime' },
135+
testapp: {
136+
import: './wwwroot/component/TestApp.tsx',
137+
dependOn: ['reactvendors', 'moment'],
138+
},
139+
},
140+
};
141+
```
142+
143+
Also, you can specify multiple files per entry using an array:
127144

128145
```js
129146
module.exports = {

0 commit comments

Comments
 (0)