diff --git a/package-lock.json b/package-lock.json index 7c9f508..5591a14 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.0-development", "license": "MIT", "devDependencies": { - "@octokit/tsconfig": "^2.0.0", + "@octokit/tsconfig": "^3.0.0", "@types/jest": "^29.0.0", "@types/node": "^20.0.0", "esbuild": "^0.20.0", @@ -1664,9 +1664,9 @@ } }, "node_modules/@octokit/tsconfig": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@octokit/tsconfig/-/tsconfig-2.0.0.tgz", - "integrity": "sha512-tWnrai3quGt8+gRN2edzo9fmraWekeryXPeXDomMw2oFSpu/lH3VSWGn/q4V+rwjTRMeeXk/ci623/01Zet4VQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@octokit/tsconfig/-/tsconfig-3.0.0.tgz", + "integrity": "sha512-tQLwgXYfBq9iUbOq26kWCzsJL6DY7qjOLzqcg5tCFQ4ob48H47iX98NudHW7S5OQ/fpSKYJhb3eQehyBNzYjfA==", "dev": true }, "node_modules/@octokit/types": { diff --git a/package.json b/package.json index 448913a..139e9c8 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "publishConfig": { "access": "public" }, + "type": "module", "version": "0.0.0-development", "description": "Methods to handle GitHub Webhook requests", "scripts": { @@ -27,7 +28,7 @@ "author": "Gregor Martynus (https://dev.to/gr2m)", "license": "MIT", "devDependencies": { - "@octokit/tsconfig": "^2.0.0", + "@octokit/tsconfig": "^3.0.0", "@types/jest": "^29.0.0", "@types/node": "^20.0.0", "esbuild": "^0.20.0", diff --git a/scripts/build.mjs b/scripts/build.mjs index bef1cf8..c329f9b 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -32,7 +32,7 @@ async function main() { bundle: true, platform: "node", target: "node18", - format: "cjs", + format: "esm", ...sharedOptions, }), // Build an ESM browser bundle @@ -62,10 +62,16 @@ async function main() { { ...pkg, files: ["dist-*/**"], - main: "dist-node/index.js", - browser: "dist-web/index.js", - types: "dist-types/index.d.ts", - module: "dist-src/index.js", + exports: { + node: { + import: "./dist-node/index.js", + types: "./dist-types/index.d.ts", + }, + browser: { + import: "./dist-web/index.js", + types: "./dist-types/web.d.ts", + }, + }, sideEffects: false, }, null,