From 2e641e9e8c65c31ef939dbbbd708f1f59e4cd875 Mon Sep 17 00:00:00 2001 From: Alexander Kachkaev Date: Wed, 7 Mar 2018 08:13:12 +0000 Subject: [PATCH] Use separate tsconfig for server in custom-server-typescript example (#3963) --- examples/custom-server-typescript/package.json | 2 +- examples/custom-server-typescript/tsconfig.json | 8 ++------ examples/custom-server-typescript/tsconfig.server.json | 8 ++++++++ 3 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 examples/custom-server-typescript/tsconfig.server.json diff --git a/examples/custom-server-typescript/package.json b/examples/custom-server-typescript/package.json index 02a79422..11faa2f8 100644 --- a/examples/custom-server-typescript/package.json +++ b/examples/custom-server-typescript/package.json @@ -1,7 +1,7 @@ { "scripts": { "dev": "nodemon server/index.ts", - "build": "next build && tsc --module commonjs", + "build": "next build && tsc --project tsconfig.server.json", "start": "NODE_ENV=production node production-server/index.js" }, "dependencies": { diff --git a/examples/custom-server-typescript/tsconfig.json b/examples/custom-server-typescript/tsconfig.json index 900e506d..41a1f0af 100644 --- a/examples/custom-server-typescript/tsconfig.json +++ b/examples/custom-server-typescript/tsconfig.json @@ -21,10 +21,6 @@ "dom", "es2015", "es2016" - ], - "outDir": "production-server/" - }, - "include": [ - "server/**/*.ts" - ] + ] + } } diff --git a/examples/custom-server-typescript/tsconfig.server.json b/examples/custom-server-typescript/tsconfig.server.json new file mode 100644 index 00000000..c9e53ca0 --- /dev/null +++ b/examples/custom-server-typescript/tsconfig.server.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "commonjs", + "outDir": "production-server/" + }, + "include": ["server/**/*.ts"] +}