From f8b07b3652372e1dad946b2e6a0b1d43817e3bad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20Magalh=C3=A3es?= Date: Sun, 4 Jul 2021 22:18:50 +0200 Subject: [PATCH] fix: typescript declarations missing from package --- package.json | 2 +- rollup.config.js | 6 ++++-- tsconfig.json | 8 +++++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 8aa6b64..c850f37 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ }, "main": "dist/index.js", "module": "dist/index.es.js", - "typings": "dist/index.d.ts", + "typings": "dist/types/index.d.ts", "jsnext:main": "dist/index.es.js", "keywords": [ "react", diff --git a/rollup.config.js b/rollup.config.js index ca0a368..c233eb3 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -20,13 +20,15 @@ export default { format: 'es', exports: 'named', sourcemap: true - } + }, ], plugins: [ external(), url(), resolve(), - typescript(), + typescript({ + tsconfig: './tsconfig.json', + }), commonjs() ] } diff --git a/tsconfig.json b/tsconfig.json index c4c3640..920686f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -22,15 +22,17 @@ "sourceMap": true, "resolveJsonModule": true, "declaration": true, - "outDir": "build", "module": "esnext", "target": "es5", - "lib": ["es6", "dom", "es2016", "es2017"], + "lib": ["dom", "esnext"], "allowJs": false, "jsx": "react", "moduleResolution": "node", "suppressImplicitAnyIndexErrors": true, - "noUnusedParameters": true + "noUnusedParameters": true, + "rootDir": "./src", + "outDir": "build", + "declarationDir": "types" }, "include": ["src"], "exclude": ["node_modules", "build", "dist", "example", "rollup.config.js"]