From de8ee9ba85e0160b0b472cab44f92c01796efec8 Mon Sep 17 00:00:00 2001 From: sct Date: Sun, 23 Aug 2020 06:34:38 +0000 Subject: [PATCH] fix: fixes next.js build to not include server files Also fixes the next.js build to properly purge unused css classes from tailwind --- package.json | 2 +- server/tsconfig.json | 3 ++- tailwind.config.js | 2 +- tsconfig.json | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index b63e8f12d..17aef5445 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "build:next": "next build", "build": "yarn build:next && yarn build:server", "lint": "eslint \"./server/**/*.{ts,tsx}\" \"./src/**/*.{ts,tsx}\"", - "start": "NODE_ENV=production node dist/server/index.js" + "start": "NODE_ENV=production node dist/index.js" }, "dependencies": { "@tailwindcss/ui": "^0.5.0", diff --git a/server/tsconfig.json b/server/tsconfig.json index e27ab81e5..773022433 100644 --- a/server/tsconfig.json +++ b/server/tsconfig.json @@ -7,5 +7,6 @@ "strictPropertyInitialization": false, "experimentalDecorators": true, "emitDecoratorMetadata": true - } + }, + "include": ["**/*.ts", "**/*.tsx"] } diff --git a/tailwind.config.js b/tailwind.config.js index 5439340d5..4a75d60aa 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -2,7 +2,7 @@ const defaultTheme = require('tailwindcss/defaultTheme'); module.exports = { - purge: ['./pages/**/*.{ts,tsx}', './components/**/*.{ts,tsx}'], + purge: ['./src/pages/**/*.{ts,tsx}', './src/components/**/*.{ts,tsx}'], theme: { extend: { fontFamily: { diff --git a/tsconfig.json b/tsconfig.json index 4fa631c26..f395aa1d5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,6 +14,6 @@ "isolatedModules": true, "jsx": "preserve" }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], + "include": ["next-env.d.ts", "src/**/*.ts", "src/**/*.tsx"], "exclude": ["node_modules"] }