From 54dcb31c4e17a51c177f123b2f68b7cb5dd9693f Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 28 Aug 2021 11:38:59 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=A6=20Configure=20typescript=20to=20ou?= =?UTF-8?q?tput=20declarations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 5 +++-- rollup.config.js | 4 +++- tsconfig.json | 8 +++++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 27f0776..8adf62c 100644 --- a/package.json +++ b/package.json @@ -75,11 +75,12 @@ "babel-loader": "8.1.0" }, "files": [ - "dist/bluelib-react.js" + "dist/**/*" ], "main": "dist/bluelib-react.js", + "types": "dist/index.d.ts", "scripts": { - "package:build": "webpack", + "package:build": "rollup -c", "storybook:start": "start-storybook -p 30060 -s public", "storybook:build": "build-storybook -s public", "storybook:deploy": "storybook-to-ghpages" diff --git a/rollup.config.js b/rollup.config.js index 9c0ec61..66f5c11 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -25,7 +25,9 @@ export default { postcss({ modules: true, }), - typescript(), + typescript({ + tsconfig: "./tsconfig.json", + }), babel({ babelHelpers: "runtime", presets: ["@babel/preset-env", "@babel/preset-react"], diff --git a/tsconfig.json b/tsconfig.json index c482d94..e70263e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,9 +19,15 @@ "isolatedModules": true, "noEmit": true, "jsx": "react-jsx", - "sourceMap": true + "sourceMap": true, + "outDir": "dist", + "declaration": true, + "declarationDir": "." }, "include": [ "src" + ], + "exclude": [ + "dist" ] }