build: compile as esm (#888)

This commit is contained in:
Michael Kriese authored and GitHub committed 2024-11-08 15:32:08 +00:00
1 parent 4a407be28a
commit e8fc25c747
8 files changed
+14 -7

No files matched your search

File renamed without changes.
File renamed without changes.
+1
View File
@@ -13,6 +13,7 @@
},
"license": "GPL-3.0-or-later",
"author": "Jeroen de Bruijn",
"type": "module",
"main": "src/index.ts",
"scripts": {
"build": "run-s clean compile",
+1 -1
View File
@@ -1,5 +1,5 @@
import { getInput } from '@actions/core';
import path from 'path';
import path from 'node:path';
export interface EnvironmentVariable {
key: string;
+2 -2
View File
@@ -1,8 +1,8 @@
import { Docker } from './docker';
import { Input } from './input';
import { exec } from '@actions/exec';
import fs from 'fs/promises';
import path from 'path';
import fs from 'node:fs/promises';
import path from 'node:path';
export class Renovate {
static dockerGroupRegex = /^docker:x:(?<groupId>[1-9][0-9]*):/m;
+8
View 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);
+2 -1
View File
@@ -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
});
-3
View File
@@ -1,3 +0,0 @@
{
"type": "module"
}