From fbef4bd2d6cecae47a046c856d2b48861312755f Mon Sep 17 00:00:00 2001 From: Prateek Bhatnagar Date: Thu, 1 Nov 2018 14:51:08 -0700 Subject: [PATCH] Publish types in npm package (#98) * publish types in npm package * fixes nits * Delete package-lock.json --- package.json | 2 ++ rollup.config.js | 11 +++++++++-- tsconfig.json | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 8a2ab141..0747a752 100644 --- a/package.json +++ b/package.json @@ -45,10 +45,12 @@ "prettier": "1.14.3", "rimraf": "2.6.2", "rollup": "0.66.6", + "rollup-plugin-copy": "0.2.3", "tslint": "5.11.0", "typescript": "3.1.3" }, "files": [ + "dist/index.d.ts", "dist/index.js", "dist/index.mjs" ], diff --git a/rollup.config.js b/rollup.config.js index 8599d548..886fc47d 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -16,13 +16,20 @@ import pkg from './package.json'; import builtins from 'builtins'; +import copy from 'rollup-plugin-copy'; export default { input: './transpile/index.js', external: [ ...builtins(), ...Object.keys(pkg.dependencies || {}), - ...Object.keys(pkg.peerDependencies || {}), + ...Object.keys(pkg.peerDependencies || {}), + ], + plugins: [ + copy({ + './transpile/index.d.ts': './dist/index.d.ts', + verbose: true, + }), ], output: [ { @@ -34,4 +41,4 @@ export default { format: 'cjs', }, ], -} \ No newline at end of file +}; diff --git a/tsconfig.json b/tsconfig.json index 9d7d08bc..520a4199 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,6 +15,7 @@ "noImplicitAny": true, "noImplicitThis": true, "alwaysStrict": true, + "declaration": true, "module": "esnext" }, "include": [