diff --git a/README.md b/README.md index 8694b11..70c4e45 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,12 @@ const { oauthAuthorizationUrl } = require("@octokit/oauth-authorization-url"); +> [!IMPORTANT] +> As we use [conditional exports](https://nodejs.org/api/packages.html#conditional-exports), you will need to adapt your `tsconfig.json` by setting `"moduleResolution": "node16", "module": "node16"`. +> +> See the TypeScript docs on [package.json "exports"](https://www.typescriptlang.org/docs/handbook/modules/reference.html#packagejson-exports).
+> See this [helpful guide on transitioning to ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) from [@sindresorhus](https://github.com/sindresorhus) + ### For OAuth Apps ```js diff --git a/scripts/build.mjs b/scripts/build.mjs index cba6f6b..09929fe 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -52,12 +52,13 @@ async function main() { { ...pkg, files: ["dist-*/**"], - main: "./dist-src/index.js", types: "./dist-types/index.d.ts", exports: { ".": { types: "./dist-types/index.d.ts", import: "./dist-src/index.js", + // Tooling currently are having issues with the "exports" field when there is no "default", ex: TypeScript, eslint + default: "./dist-src/index.js", }, }, sideEffects: false,