mirror of
https://github.com/renovatebot/github-action.git
synced 2025-12-26 12:33:37 +00:00
fix: add cjs shim
This commit is contained in:
parent
1544d86fa0
commit
161f5b4092
2 changed files with 9 additions and 0 deletions
8
tools/cjs-shim.ts
Normal file
8
tools/cjs-shim.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
// https://github.com/evanw/esbuild/issues/1921#issuecomment-1898197331
|
||||
import { createRequire } from 'node:module';
|
||||
import path from 'node:path';
|
||||
import url from 'node:url';
|
||||
|
||||
globalThis.require = createRequire(import.meta.url);
|
||||
globalThis.__filename = url.fileURLToPath(import.meta.url);
|
||||
globalThis.__dirname = path.dirname(__filename);
|
||||
|
|
@ -11,4 +11,5 @@ await build({
|
|||
sourcemap: true,
|
||||
format: 'esm',
|
||||
outdir: './dist/',
|
||||
inject: ['tools/cjs-shim.ts'], // https://github.com/evanw/esbuild/issues/1921#issuecomment-1898197331
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue