diff --git a/package.json b/package.json index 9201cb0..93c4e45 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "lint:package": "pnpm publint --pack npm", "format": "pnpm oxfmt", "format:check": "pnpm oxfmt --check", - "build": "pnpm tsc", + "build": "pnpm tsc -p tsconfig.build.json", "postbuild": "rollup dist/src/index.js --file dist/src/index.cjs --format cjs && cp dist/src/index.d.ts dist/src/index.d.cts", "prepublishOnly": "pnpm build", "build-js-client": "pnpm tsc --declaration false --outDir js-dist" diff --git a/tsconfig.build.json b/tsconfig.build.json new file mode 100644 index 0000000..ca153b1 --- /dev/null +++ b/tsconfig.build.json @@ -0,0 +1,7 @@ +{ + // Build config for the published package: excludes test files from dist/. + // `extends` REPLACES the base exclude array (it does not merge), so + // "node_modules" must be re-listed here alongside the test glob. + "extends": "./tsconfig.json", + "exclude": ["node_modules", "src/**/*.test.*"] +} diff --git a/tsconfig.json b/tsconfig.json index 811dec5..a265378 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,5 +12,5 @@ "typeRoots": ["node_modules/@types"] }, "include": ["src"], - "exclude": ["node_modules", "src/**/*.test.*/*"] + "exclude": ["node_modules"] }