mirror of
https://github.com/renovatebot/github-action.git
synced 2025-12-15 16:32:36 +00:00
build: compile as esm (#888)
This commit is contained in:
parent
4a407be28a
commit
e8fc25c747
8 changed files with 14 additions and 7 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);
|
||||
|
|
@ -9,6 +9,7 @@ await build({
|
|||
minify: !!env['CI'],
|
||||
tsconfig: 'tsconfig.dist.json',
|
||||
sourcemap: true,
|
||||
// format: 'esm', // TODO: later PR
|
||||
format: 'esm',
|
||||
outdir: './dist/',
|
||||
inject: ['tools/cjs-shim.ts'], // https://github.com/evanw/esbuild/issues/1921#issuecomment-1898197331
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"type": "module"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue