From 9eb3e058d795029b70191960fac92806c5a2dafc Mon Sep 17 00:00:00 2001 From: Huw Wilkins Date: Tue, 3 Sep 2024 15:25:30 +1000 Subject: [PATCH] build: allow typescript to run on tests --- package.json | 4 ++-- tsconfig.build.json | 4 ++++ tsconfig.json | 3 +-- 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 tsconfig.build.json diff --git a/package.json b/package.json index 1aeb2cd3d..a33767ae3 100644 --- a/package.json +++ b/package.json @@ -122,8 +122,8 @@ }, "scripts": { "build": "rm -rf dist && yarn build-local; yarn build-declaration", - "build-local": "NODE_ENV=production babel src --out-dir dist --copy-files --extensions '.js,.jsx,.ts,.tsx'", - "build-declaration": "tsc --project tsconfig.json && tsc-alias -p tsconfig.json", + "build-local": "NODE_ENV=production babel src --out-dir dist --copy-files --no-copy-ignored --extensions '.js,.jsx,.ts,.tsx,.snap' --ignore '**/*.test.ts','**/*.test.tsx','**/*.stories.tsx','**/__snapshots__','src/setupTests.js','src/testing'", + "build-declaration": "tsc --project tsconfig.build.json && tsc-alias -p tsconfig.build.json", "build-watch": "yarn run build-local --watch", "build-docs": "storybook build -c .storybook -o docs", "clean": "rm -rf node_modules dist .out", diff --git a/tsconfig.build.json b/tsconfig.build.json new file mode 100644 index 000000000..c412aa2c8 --- /dev/null +++ b/tsconfig.build.json @@ -0,0 +1,4 @@ +{ + "exclude": ["src/**/*.test.*", "src/**/*.stories.*"], + "extends": "./tsconfig.json" +} diff --git a/tsconfig.json b/tsconfig.json index 74e3892bb..c11c2f2c8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -30,6 +30,5 @@ "utils": ["./utils"] } }, - "include": ["src/**/*.ts", "src/**/*.tsx"], - "exclude": ["src/**/*.test.ts", "src/**/*.test.tsx"] + "include": ["src/**/*"] }