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"] +}