Skip to content

Commit f8b07b3

Browse files
committed
fix: typescript declarations missing from package
1 parent a483435 commit f8b07b3

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"main": "dist/index.js",
1212
"module": "dist/index.es.js",
13-
"typings": "dist/index.d.ts",
13+
"typings": "dist/types/index.d.ts",
1414
"jsnext:main": "dist/index.es.js",
1515
"keywords": [
1616
"react",

rollup.config.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@ export default {
2020
format: 'es',
2121
exports: 'named',
2222
sourcemap: true
23-
}
23+
},
2424
],
2525
plugins: [
2626
external(),
2727
url(),
2828
resolve(),
29-
typescript(),
29+
typescript({
30+
tsconfig: './tsconfig.json',
31+
}),
3032
commonjs()
3133
]
3234
}

tsconfig.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,17 @@
2222
"sourceMap": true,
2323
"resolveJsonModule": true,
2424
"declaration": true,
25-
"outDir": "build",
2625
"module": "esnext",
2726
"target": "es5",
28-
"lib": ["es6", "dom", "es2016", "es2017"],
27+
"lib": ["dom", "esnext"],
2928
"allowJs": false,
3029
"jsx": "react",
3130
"moduleResolution": "node",
3231
"suppressImplicitAnyIndexErrors": true,
33-
"noUnusedParameters": true
32+
"noUnusedParameters": true,
33+
"rootDir": "./src",
34+
"outDir": "build",
35+
"declarationDir": "types"
3436
},
3537
"include": ["src"],
3638
"exclude": ["node_modules", "build", "dist", "example", "rollup.config.js"]

0 commit comments

Comments
 (0)