From 4a7c9005f581ba85b3a580421ef8782a87750e68 Mon Sep 17 00:00:00 2001 From: Kasper Peulen Date: Thu, 10 Oct 2024 15:23:40 +0200 Subject: [PATCH] Use specific tsconfig for build that doesn't build test files --- package.json | 4 ++-- tsconfig.build.json | 23 +++++++++++++++++++++++ tsconfig.json | 23 ++--------------------- 3 files changed, 27 insertions(+), 23 deletions(-) create mode 100644 tsconfig.build.json diff --git a/package.json b/package.json index 7333b85..13fcced 100644 --- a/package.json +++ b/package.json @@ -24,14 +24,14 @@ "email": "rafaelrozon.developer@gmail.com" } ], - "main": "dist/lib/index.js", + "main": "dist/index.js", "files": [ "dist/**/*", "README.md" ], "scripts": { "prebuild": "rimraf dist", - "build": "tsc", + "build": "tsc -p tsconfig.build.json", "generate-rule": "ts-node ./tools/generate-rule", "lint": "eslint --fix .", "migrate": "ts-migrate-full", diff --git a/tsconfig.build.json b/tsconfig.build.json new file mode 100644 index 0000000..eed0f62 --- /dev/null +++ b/tsconfig.build.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "outDir": "./dist/", + "target": "es6", + "module": "Node16", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true, + "noUncheckedIndexedAccess": true + }, + "ts-node": { + "transpileOnly": true + }, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaFeatures": { "jsx": true }, + "ecmaVersion": 8, + "sourceType": "module" + }, + "include": ["lib/**/*.ts"], + "exclude": ["node_modules"] +} diff --git a/tsconfig.json b/tsconfig.json index 5b05e7e..503dc7b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,23 +1,4 @@ { - "compilerOptions": { - "outDir": "./dist/", - "target": "es6", - "module": "Node16", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "strict": true, - "skipLibCheck": true, - "noUncheckedIndexedAccess": true - }, - "ts-node": { - "transpileOnly": true - }, - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaFeatures": { "jsx": true }, - "ecmaVersion": 8, - "sourceType": "module" - }, - "include": ["lib/**/*.ts", "tests/**/*.ts"], - "exclude": ["node_modules"] + "extends": "./tsconfig.build.json", + "include": ["lib/**/*.ts", "tests/**/*.ts"] }