Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit dff1ec6

Browse files
committedOct 22, 2020
Fix yarn build
* Create a separate `tsconfig.build.json` so that tests are not included in the `/build`, but we still get typechecking for our test files * References: - https://kjaer.io/ts-npm-config/ - https://github.com/MaximeKjaer/npm-ts-template
1 parent 8f5151c commit dff1ec6

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed
 

‎package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
"dist/"
99
],
1010
"scripts": {
11-
"build": "tsc -p tsconfig.json",
12-
"test": "jest"
11+
"build": "tsc -p tsconfig.build.json",
12+
"test": "jest",
13+
"lint": "eslint src/**/*",
14+
"typecheck": "tsc --noEmit"
1315
},
1416
"devDependencies": {
1517
"@types/jest": "^26.0.14",

‎tsconfig.build.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "./dist",
5+
"noEmit": false
6+
},
7+
"include": ["src"]
8+
}

‎tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"compilerOptions": {
33
"target": "es5",
44
"module": "commonjs",
5+
"noEmit": true,
56
"declaration": true,
67
"strict": true,
78
"noImplicitAny": true,
@@ -11,8 +12,7 @@
1112
"alwaysStrict": true,
1213
"noFallthroughCasesInSwitch": true,
1314
"esModuleInterop": true,
14-
"forceConsistentCasingInFileNames": true,
15-
"outDir": "./dist"
15+
"forceConsistentCasingInFileNames": true
1616
},
1717
"include": [
1818
"./src", "./test"

0 commit comments

Comments
 (0)
Please sign in to comment.