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"]