plugin-template/dist/types.js
saberzero1 2117d4ace2
fix: add createRequire banner for CJS compat in ESM bundles
Bundled CJS dependencies (e.g. reading-time) use require() for Node
builtins like 'stream' and 'util'. In ESM output, the esbuild-generated
__require shim throws 'Dynamic require of X is not supported' because
there is no global require in ESM context.

Add platform: 'node' and a banner that injects createRequire from the
'module' builtin, providing a working require() function for the CJS
compatibility layer.
2026-03-17 20:34:33 +01:00

5 lines
No EOL
140 B
JavaScript

import { createRequire } from 'module';
createRequire(import.meta.url);
//# sourceMappingURL=types.js.map
//# sourceMappingURL=types.js.map