From 2a126cabb8c411ba5d14d61b0e1fa3a8ce8c1930 Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Tue, 15 Aug 2017 09:23:53 +0900 Subject: [PATCH] Remove description about module ID 0 0 as the ID of a module does not tell it is an entry point because the ID can be affected by optimize-module-order plugins. --- content/api/module-methods.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/content/api/module-methods.md b/content/api/module-methods.md index 15a92974eef8..ad57f7d26cbf 100644 --- a/content/api/module-methods.md +++ b/content/api/module-methods.md @@ -126,13 +126,6 @@ require.resolve(dependency: String) 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. -``` javascript -var id = require.resolve("dependency"); -typeof id === "number"; -id === 0 // if dependency is the entry point -id > 0 // elsewise -``` - W> Module ID is a number in webpack (in contrast to NodeJS where it is a string -- the filename).