Stubs the Node-only imports inside TeaVM's generated runtime.
The runtime reads a module off disk with import('node:fs/promises') on a branch bytebox never
takes, since it drives defaults and never the generated load. esbuild resolves a dynamic
import's literal specifier whether the branch can run or not, so a Workers target with no Node
builtins fails the whole bundle on unreachable code.
Only imports made by the runtime itself are stubbed, so a project that does use nodejs_compat
keeps its own Node imports.
Stubs the Node-only imports inside TeaVM's generated runtime.
The runtime reads a module off disk with
import('node:fs/promises')on a branch bytebox never takes, since it drivesdefaultsand never the generatedload. esbuild resolves a dynamic import's literal specifier whether the branch can run or not, so a Workers target with no Node builtins fails the whole bundle on unreachable code.Only imports made by the runtime itself are stubbed, so a project that does use
nodejs_compatkeeps its own Node imports.