Skip to content

Commit c45abc3

Browse files
authored
fix(pkg): add a default fallback export (#405)
* docs: add note on needed config changes for TypeScript * fix(pkg): add a default fallback export
1 parent 2a237e3 commit c45abc3

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ const authentication = await auth();
3737
// }
3838
```
3939

40+
> [!IMPORTANT]
41+
> 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"`.
42+
>
43+
> See the TypeScript docs on [package.json "exports"](https://www.typescriptlang.org/docs/handbook/modules/reference.html#packagejson-exports).<br>
44+
> See this [helpful guide on transitioning to ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) from [@sindresorhus](https://github.com/sindresorhus)
45+
4046
## `createActionAuth()`
4147

4248
The `createActionAuth()` method has no options.

scripts/build.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,13 @@ async function main() {
5656
{
5757
...pkg,
5858
files: ["dist-*/**"],
59-
main: "dist-src/index.js",
6059
types: "dist-types/index.d.ts",
6160
exports: {
6261
".": {
6362
types: "./dist-types/index.d.ts",
6463
import: "./dist-src/index.js",
64+
// Tooling currently are having issues with the "exports" field when there is no "default", ex: TypeScript, eslint
65+
default: "./dist-src/index.js",
6566
}
6667
},
6768
sideEffects: false,

0 commit comments

Comments
 (0)