From e40a815d073f559e209795ea4c76c6cdf5fcf09a Mon Sep 17 00:00:00 2001 From: sct Date: Sun, 11 Oct 2020 00:51:32 +0000 Subject: [PATCH] build: fix production build --- ormconfig.js | 8 ++++---- server/overseerr-api.yml => overseerr-api.yml | 0 server/index.ts | 5 ++--- server/tsconfig.json | 2 ++ 4 files changed, 8 insertions(+), 7 deletions(-) rename server/overseerr-api.yml => overseerr-api.yml (100%) diff --git a/ormconfig.js b/ormconfig.js index 92205cda5..93da376bc 100644 --- a/ormconfig.js +++ b/ormconfig.js @@ -16,12 +16,12 @@ const prodConfig = { database: 'config/db/db.sqlite3', synchronize: false, logging: false, - entities: ['dist/server/entity/**/*.js'], - migrations: ['dist/server/migration/**/*.js'], + entities: ['dist/entity/**/*.js'], + migrations: ['dist/migration/**/*.js'], migrationsRun: true, cli: { - entitiesDir: 'dist/server/entity', - migrationsDir: 'dist/server/migration', + entitiesDir: 'dist/entity', + migrationsDir: 'dist/migration', }, }; diff --git a/server/overseerr-api.yml b/overseerr-api.yml similarity index 100% rename from server/overseerr-api.yml rename to overseerr-api.yml diff --git a/server/index.ts b/server/index.ts index e4d57c53d..bf5b3a017 100644 --- a/server/index.ts +++ b/server/index.ts @@ -14,17 +14,16 @@ import { Session } from './entity/Session'; import { getSettings } from './lib/settings'; import logger from './logger'; -const API_SPEC_PATH = path.join(__dirname, 'overseerr-api.yml'); +const API_SPEC_PATH = path.join(__dirname, '../overseerr-api.yml'); const dev = process.env.NODE_ENV !== 'production'; const app = next({ dev }); const handle = app.getRequestHandler(); -createConnection(); - app .prepare() .then(async () => { + await createConnection(); // Load Settings getSettings().load(); diff --git a/server/tsconfig.json b/server/tsconfig.json index 607d63ac2..eb4037039 100644 --- a/server/tsconfig.json +++ b/server/tsconfig.json @@ -1,6 +1,8 @@ { "extends": "../tsconfig.json", "compilerOptions": { + "target": "ES2019", + "lib": ["ES2019"], "module": "commonjs", "outDir": "../dist", "noEmit": false