Skip to content

Commit d5ac943

Browse files
build(tsconfig): create a separate tsconfig.test.json
1 parent b237d9e commit d5ac943

File tree

5 files changed

+32
-18
lines changed

5 files changed

+32
-18
lines changed

jest.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ const config: Config = {
1616
? [['github-actions', { silent: false }], 'summary']
1717
: undefined,
1818
testMatch: ['**/__tests__/**/*.test.ts?(x)'],
19+
transform: {
20+
'^.+\\.m?[tj]sx?$': [
21+
'ts-jest',
22+
{
23+
tsconfig: 'tsconfig.test.json',
24+
},
25+
],
26+
},
1927
watchPlugins: [
2028
'jest-watch-typeahead/filename',
2129
'jest-watch-typeahead/testname',

rollup.config.mjs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import typescript from '@rollup/plugin-typescript';
55

66
const getConfig = (minify = false) => ({
77
external: ['react'],
8-
98
input: 'umd/index.ts',
109

1110
output: {
@@ -20,11 +19,11 @@ const getConfig = (minify = false) => ({
2019

2120
plugins: [
2221
typescript({
23-
declaration: false,
24-
declarationMap: false,
25-
module: 'esnext',
2622
tsconfig: 'tsconfig.build.json',
2723
compilerOptions: {
24+
declaration: false,
25+
declarationMap: false,
26+
module: 'esnext',
2827
outDir: 'dist',
2928
},
3029
}),

tsconfig.build.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
{
2-
"extends": "./tsconfig.json",
2+
"compilerOptions": {
3+
"target": "es5",
4+
"module": "commonjs",
5+
"lib": ["es5"],
6+
"esModuleInterop": true,
7+
"declaration": true,
8+
"declarationMap": true,
9+
"sourceMap": true,
10+
"strict": true,
11+
"outDir": "lib",
12+
"jsx": "react-jsx"
13+
},
314
"include": ["src"]
415
}

tsconfig.json

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
{
2-
"compilerOptions": {
3-
"target": "es5",
4-
"module": "commonjs",
5-
"lib": ["es5"],
6-
"esModuleInterop": true,
7-
"declaration": true,
8-
"declarationMap": true,
9-
"sourceMap": true,
10-
"strict": true,
11-
"outDir": "lib",
12-
"jsx": "react-jsx"
13-
},
14-
"include": ["__tests__", "benchmark", "src"]
2+
"files": [],
3+
"references": [
4+
{ "path": "./tsconfig.build.json" },
5+
{ "path": "./tsconfig.test.json" }
6+
]
157
}

tsconfig.test.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "./tsconfig.build.json",
3+
"include": ["__tests__", "benchmark", "src", "*.mjs", "*.ts"]
4+
}

0 commit comments

Comments
 (0)