Skip to content

Commit 809be87

Browse files
committed
fix(nextjs): add import condition to exports map, emit type declarations
Adds 'import' condition alongside 'module' so TypeScript moduleResolution bundler resolves the package types correctly. Switches tsconfig from noEmit to emitDeclarationOnly so tsc generates index.d.ts in dist/.
1 parent bb006e9 commit 809be87

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

src/nextjs/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.0.1",
44
"exports": {
55
".": {
6+
"import": "./dist/index.mjs",
67
"module": "./dist/index.mjs",
78
"types": "./dist/index.d.ts"
89
}

src/nextjs/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
22
"compilerOptions": {
33
"declaration": true,
4+
"emitDeclarationOnly": true,
5+
"outDir": "./dist",
46
"target": "ESNext",
57
"lib": ["esnext"],
68
"skipLibCheck": true,
79
"strict": false,
8-
"noEmit": true,
910
"esModuleInterop": true,
1011
"module": "esnext",
1112
"moduleResolution": "bundler",

0 commit comments

Comments
 (0)