mirror of
https://github.com/wekan/wekan.git
synced 2026-11-25 04:49:41 -05:00
The crash moved from yargs/lib/platform-shims/esm.mjs to yargs/build/lib/utils/ apply-extends.js (import.meta.resolve(config.extends)) — yargs' ESM build has more than one file using import.meta. Rewrite the workaround to scan the whole node_modules/yargs tree and rewrite every ESM-only construct (import.meta.url/.resolve/.dirname/.filename, const require = createRequire(...), and yargs' own const __dirname) to the CommonJS wrapper equivalents in one pass, so a new yargs file can't reintroduce the boot crash. yargs is never executed at runtime here, so only valid CommonJS parsing matters. Thanks to xet7.