web: add default export to CJS bundle

(cherry picked from commit 081c90b769)
This commit is contained in:
Chad McElligott 2026-02-09 21:23:12 -06:00 committed by Amaan Qureshi
parent 79b60a271c
commit 3b85287d6d

View file

@ -44,6 +44,9 @@ async function build() {
keepNames: true,
external: ['fs/*', 'fs/promises'],
resolveExtensions: ['.ts', '.js', format === 'esm' ? '.mjs' : '.cjs'],
...(format === 'cjs' ? {
footer: { js: 'module.exports.default = module.exports;' },
} : {}),
});
// Copy the Wasm files to the appropriate spot, as esbuild doesn't "bundle" Wasm files