Skip to content

Commit aaf4acd

Browse files
akihikodakiskipjack
authored andcommitted
docs(api): update module-methods (#1527)
Remove description about `id` 0 as this `module.id` doesn't necessarily mean it is an entry point as it can be affected by various plugins and the `--optimize-module-order` flag.
1 parent 94cbd1a commit aaf4acd

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

content/api/module-methods.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,6 @@ require.resolve(dependency: String)
126126

127127
Synchronously retrieve a module's ID. The compiler will ensure that the dependency is available in the output bundle. See [`module.id`](/api/module-variables#module-id-commonjs-) for more information.
128128

129-
``` javascript
130-
var id = require.resolve("dependency");
131-
typeof id === "number";
132-
id === 0 // if dependency is the entry point
133-
id > 0 // elsewise
134-
```
135-
136129
W> Module ID is a number in webpack (in contrast to NodeJS where it is a string -- the filename).
137130

138131

0 commit comments

Comments
 (0)