From 1349e1dca6869f29a6e8dbbf7ba8222294ef1838 Mon Sep 17 00:00:00 2001 From: Aaron Lampros Date: Fri, 8 Mar 2019 10:51:09 -0500 Subject: [PATCH] feat(build): output and add types to package --- package.json | 6 ++++-- tsconfig.json | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index b807ce7..2be83a9 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,8 @@ "name": "react-confetti", "version": "2.4.1", "description": "React component to draw confetti for your party.", - "main": "index.js", + "main": "dist/react-confetti.min.js", + "types": "dist/types/ReactConfetti.d.ts", "repository": { "type": "git", "url": "https://github.com/alampros/react-confetti.git" @@ -26,7 +27,8 @@ "index.js" ], "scripts": { - "build": "rollup -c", + "build": "tsc && rollup -c", + "prebuild": "yarn clean", "develop": "rollup -c -w", "test": "tsc; yarn run lint", "clean": "git clean -xfd dist/", diff --git a/tsconfig.json b/tsconfig.json index 4a1efb1..3f4aab0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,12 +1,13 @@ { "compilerOptions": { "target": "esnext", + "module": "commonjs", "moduleResolution": "node", - "allowJs": true, + "declaration": true, + "declarationDir": "dist/types", "jsx": "preserve", - "noEmit": true, + "emitDeclarationOnly": true, "strict": true, - "isolatedModules": true, "esModuleInterop": true }, "include": [