diff --git a/package.json b/package.json index e50522db..0a598ef8 100644 --- a/package.json +++ b/package.json @@ -127,8 +127,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 00000000..c412aa2c --- /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 74e3892b..c11c2f2c 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/**/*"] }