Skip to content

Commit

Permalink
Ensure co-located test files don't have definitions generated (#472)
Browse files Browse the repository at this point in the history
* 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 <agilgur5@gmail.com>

* Update src/createRollupConfig.ts

Co-Authored-By: Anton Gilgur <agilgur5@gmail.com>

* Update src/createRollupConfig.ts

Co-Authored-By: Anton Gilgur <agilgur5@gmail.com>

Co-authored-by: Anton Gilgur <agilgur5@gmail.com>
  • Loading branch information
selbekk and agilgur5 authored Feb 3, 2020
1 parent 1b9092b commit a56894f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/createRollupConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,18 @@ export async function createRollupConfig(
cacheRoot: `./node_modules/.cache/tsdx/${opts.format}/`,
tsconfig: opts.tsconfig,
tsconfigDefaults: {
exclude: [
// all TS test files, regardless whether co-located or in test/ etc
'**/*.spec.ts',
'**/*.test.ts',
'**/*.spec.tsx',
'**/*.test.tsx',
// TS defaults below
'node_modules',
'bower_components',
'jspm_packages',
paths.appDist,
],
compilerOptions: {
sourceMap: true,
declaration: true,
Expand Down

0 comments on commit a56894f

Please sign in to comment.