Skip to content

Commit df7efbf

Browse files
docs: clarify entry syntax and output filename behavior (#8079)
1 parent d61e3fe commit df7efbf

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

src/content/concepts/entry-points.mdx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ T> When running webpack without a configuration file, the entry defaults to `'./
3232

3333
Usage: `entry: string | [string]`
3434

35+
- `string`: a single entry file
36+
- `[string]`: multiple entry files
37+
3538
**webpack.config.js**
3639

3740
```js
@@ -84,6 +87,11 @@ Single Entry Syntax is a great choice when you are looking to quickly set up a w
8487

8588
Usage: `entry: { <entryChunkName> string | [string] } | {}`
8689

90+
- `<entryChunkName>`: name of the entry chunk
91+
- `string`: single entry file
92+
- `[string]`: multiple entry files
93+
- `{}`: empty object
94+
8795
**webpack.config.js**
8896

8997
```js
@@ -192,22 +200,26 @@ export default {
192200
};
193201
```
194202

203+
When building in `production` mode:
204+
195205
**webpack.prod.js**
196206

197207
```js
198208
export default {
199209
output: {
200-
filename: "[name].[contenthash].bundle.js",
210+
filename: "[name].[contenthash].bundle.js", // eg: main.abc123.bundle.js, vendor.abc123.bundle.js
201211
},
202212
};
203213
```
204214

215+
When building in `development` mode:
216+
205217
**webpack.dev.js**
206218

207219
```js
208220
export default {
209221
output: {
210-
filename: "[name].bundle.js",
222+
filename: "[name].bundle.js", // eg: main.bundle.js, vendor.bundle.js
211223
},
212224
};
213225
```

0 commit comments

Comments
 (0)