You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today the Node build is commonjs2 only, so consumers must use require() or a default import (Node can't statically read named exports from the CJS bundle). This is the top capability gap for the Node support.
Proposed approach — dual CJS + ESM (non-breaking)
Keep the existing dist/ARToolkitNFT_node.js (CommonJS).
Add a separate ESM bundle, e.g. dist/ARToolkitNFT_node.mjs, via a webpack target with output.library.type: "module" + experiments.outputModule: true (and target: "node").
Wire package.jsonexports so the Node entry serves both:
Summary
Add ESM consumption for the experimental Node.js build so named imports work:
Today the Node build is
commonjs2only, so consumers must userequire()or a defaultimport(Node can't statically read named exports from the CJS bundle). This is the top capability gap for the Node support.Proposed approach — dual CJS + ESM (non-breaking)
dist/ARToolkitNFT_node.js(CommonJS).dist/ARToolkitNFT_node.mjs, via a webpack target withoutput.library.type: "module"+experiments.outputModule: true(andtarget: "node").package.jsonexportsso the Node entry serves both:mainand the existingrequire()path stay unchanged → no breaking change.Alternatives considered
require()consumers. Rejected.Tasks
output.library.type: "module").tools/makem.jsif a different wasm flavor is needed for ESM (verify the existing_node_wasmglue works under ESM).import/requireconditions to theexportsmap.example.mjs) usingimport { ARControllerNFT }.Notes
devbranch.npm run build-ts+ a runnable ESM example before release.