mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-16 23:40:32 +00:00
Add a separate tsconfig for excluding tests/mocks from builds, while leaving them for type checks
This commit is contained in:
@@ -4,8 +4,8 @@
|
|||||||
"description": "",
|
"description": "",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build:dev": "npm install --include=dev && npm run generate && tsc",
|
"build:dev": "npm install --include=dev && npm run generate && tsc --project tsconfig.build.json",
|
||||||
"build": "npm install --include=dev && npm run generate && tsc && npm prune --omit=dev",
|
"build": "npm install --include=dev && npm run generate && tsc --project tsconfig.build.json && npm prune --omit=dev",
|
||||||
"start:dev": "npm run build:dev && node ./dist/index.js",
|
"start:dev": "npm run build:dev && node ./dist/index.js",
|
||||||
"start": "npm run build && node ./dist/index.js",
|
"start": "npm run build && node ./dist/index.js",
|
||||||
"generate": "graphql-codegen --config codegen.ts",
|
"generate": "graphql-codegen --config codegen.ts",
|
||||||
|
|||||||
15
tsconfig.build.json
Normal file
15
tsconfig.build.json
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
// For builds, excludes tests and mocks
|
||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "es2016",
|
||||||
|
"module": "commonjs",
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"strict": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"outDir": "dist",
|
||||||
|
"sourceMap": true
|
||||||
|
},
|
||||||
|
"include": ["src"],
|
||||||
|
"exclude": ["**/__tests__/*/**", "**/__mocks__/*/**"]
|
||||||
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// For type-checking, includes tests and mocks
|
||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es2016",
|
"target": "es2016",
|
||||||
@@ -10,5 +11,4 @@
|
|||||||
"sourceMap": true
|
"sourceMap": true
|
||||||
},
|
},
|
||||||
"include": ["src"],
|
"include": ["src"],
|
||||||
"exclude": ["**/__tests__/*/**", "**/__mocks__/*/**"]
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user