Skip to content

Commit a960640

Browse files
authored
docs: fix typo in __dirname and __filename options (#7139)
1 parent 8bc95bc commit a960640

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/content/configuration/node.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,26 +54,26 @@ Options:
5454

5555
## node.\_\_filename
5656

57-
`boolean` `'mock' | 'warn-mock' | 'node_module' | 'eval-only'`
57+
`boolean` `'mock' | 'warn-mock' | 'node-module' | 'eval-only'`
5858

5959
Options:
6060

6161
- `true`: The filename of the **input** file relative to the [`context` option](/configuration/entry-context/#context).
6262
- `false`: Webpack won't touch your `__filename` code, which means you have the regular Node.js `__filename` behavior. The filename of the **output** file when run in a Node.js environment.
6363
- `'mock'`: The fixed value `'/index.js'`.
6464
- `'warn-mock'`: Use the fixed value of `'/index.js'` but show a warning.
65-
- `node_module`: Replace `__filename` in CommonJS modules to `fileURLToPath(import.meta.url)` when `output.module` is enabled.
65+
- `'node-module'`: Replace `__filename` in CommonJS modules to `fileURLToPath(import.meta.url)` when `output.module` is enabled.
6666
- `'eval-only'`
6767

6868
## node.\_\_dirname
6969

70-
`boolean` `'mock' | 'warn-mock' | 'node_module' | 'eval-only'`
70+
`boolean` `'mock' | 'warn-mock' | 'node-module' | 'eval-only'`
7171

7272
Options:
7373

7474
- `true`: The dirname of the **input** file relative to the [`context` option](/configuration/entry-context/#context).
7575
- `false`: Webpack won't touch your `__dirname` code, which means you have the regular Node.js `__dirname` behavior. The dirname of the **output** file when run in a Node.js environment.
7676
- `'mock'`: The fixed value `'/'`.
7777
- `'warn-mock'`: Use the fixed value of `'/'` but show a warning.
78-
- `node_module`: Replace `__dirname` in CommonJS modules to `fileURLToPath(import.meta.url + "/..")` when `output.module` is enabled.
78+
- `'node-module'`: Replace `__dirname` in CommonJS modules to `fileURLToPath(import.meta.url + "/..")` when `output.module` is enabled.
7979
- `'eval-only'`

0 commit comments

Comments
 (0)