diff --git a/.gitignore b/.gitignore index 8a8a4fd..32f56bd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ # lock -package-lock.json yarn.lock # dependencies diff --git a/.npmignore b/.npmignore index 130fdb1..267876c 100644 --- a/.npmignore +++ b/.npmignore @@ -1,6 +1,5 @@ # source lib -index.ts package-lock.json tsconfig.json .prettierrc diff --git a/index.d.ts b/index.d.ts deleted file mode 100644 index 5703fb5..0000000 --- a/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './dist'; diff --git a/index.js b/index.js deleted file mode 100644 index 9f5e27a..0000000 --- a/index.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -exports.__esModule = true; -__export(require("./dist")); diff --git a/index.ts b/index.ts deleted file mode 100644 index 5703fb5..0000000 --- a/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './dist'; diff --git a/package.json b/package.json index 4c30ab3..1005af1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,8 @@ { "name": "nestjs-telegraf", "version": "2.0.0", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", "description": "Telegraf module for NestJS", "keywords": [ "nest", @@ -25,7 +27,7 @@ ], "repository": "git@github.com:bukhalo/nestjs-telegraf.git", "scripts": { - "build": "rm -rf dist && tsc -p tsconfig.json", + "build": "rm -rf dist && tsc -p tsconfig.build.json", "precommit": "lint-staged", "prepublish:npm": "npm run build", "publish:npm": "npm publish --access public", diff --git a/tsconfig.build.json b/tsconfig.build.json new file mode 100644 index 0000000..855a530 --- /dev/null +++ b/tsconfig.build.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "rootDir": "./lib" + }, + "include": ["lib/**/*"] +} diff --git a/tsconfig.json b/tsconfig.json index 9e322c9..56083b9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,6 +13,6 @@ "outDir": "./dist", "skipLibCheck": true }, - "include": ["lib/**/*", "./sample/**/*", "../index.ts"], + "include": ["lib/**/*", "./sample/**/*"], "exclude": ["node_modules", "**/*.spec.ts"] }