Skip to content

Commit a56894f

Browse files
selbekkagilgur5
andauthored
Ensure co-located test files don't have definitions generated (#472)
* Exclude test files from typescript typings This commit fixes an issue where type declaration files were created for test files as well. * Include all of TS's defaults for exclude * Move the exclude config into the rollup config * Update src/createRollupConfig.ts Co-Authored-By: Anton Gilgur <[email protected]> * Update src/createRollupConfig.ts Co-Authored-By: Anton Gilgur <[email protected]> * Update src/createRollupConfig.ts Co-Authored-By: Anton Gilgur <[email protected]> Co-authored-by: Anton Gilgur <[email protected]>
1 parent 1b9092b commit a56894f

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/createRollupConfig.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,18 @@ export async function createRollupConfig(
140140
cacheRoot: `./node_modules/.cache/tsdx/${opts.format}/`,
141141
tsconfig: opts.tsconfig,
142142
tsconfigDefaults: {
143+
exclude: [
144+
// all TS test files, regardless whether co-located or in test/ etc
145+
'**/*.spec.ts',
146+
'**/*.test.ts',
147+
'**/*.spec.tsx',
148+
'**/*.test.tsx',
149+
// TS defaults below
150+
'node_modules',
151+
'bower_components',
152+
'jspm_packages',
153+
paths.appDist,
154+
],
143155
compilerOptions: {
144156
sourceMap: true,
145157
declaration: true,

0 commit comments

Comments
 (0)