module_graph_node.ts view source
(options: NodeModuleGraphOptions): ModuleGraph import {create_node_module_graph} from '@fuzdev/gro/module_graph_node.js'; Creates the Node ModuleGraph, which watches watch.dir with chokidar
and reads each module's imports, following them outside watch.dir,
except a package's file.
A package's file is never read, so its imports aren't edges: one a bare specifier
reaches, even when linked, and one whose path from the watched directory passes
through a node_modules directory, both from the directory as named and from its
real path.
Its implementation (with chokidar and the import parser) is imported on first use,
so a task that never queries the graph never loads them.
Bare and # imports resolve with import.meta.resolve against their importer, which Node
honors only under --experimental-import-meta-resolve, as the gro CLI and
spawn_with_loader pass it. Without the flag Node resolves them as Gro's own module would,
so one Gro can't resolve is an error through log when there is one and no edge,
and one it can, like a package both depend on or Gro's own #lib/*, is an edge to Gro's file.
options
returns
ModuleGraph