Files
dsh-context/scripts
Bowen Liang 36ae27765a build: silence commonjs-variable-in-esm warning for the harness-loader export
The client entry's `module.exports = { name, inject, apply }` is the
closure-factory contract every dsh.client package's `./client` export
must use — the harness's __ModuleLoader__ wraps the bundled CJS in a
factory that provides `var module = { exports: {} }` as a closure local
(see scripts/build.mjs:73-86), so the reference is legitimate. esbuild's
parser nonetheless flags it because the .ts source lives in a
"type": "module" package.

`logOverride: { 'commonjs-variable-in-esm': 'silent' }` suppresses that
one specific warning without touching any other esbuild signal — a future
maintainer adding a real CJS leak (e.g. require() inside the entry) would
still see a different warning. No source, test, or runtime behavior
changes; the bundled client.js still ends with the documented factory
shape that the harness's loader consumes.
2026-08-17 23:07:29 +08:00
..