From cecab786b949e1bf2c1c2db07b07d8083a83f82f Mon Sep 17 00:00:00 2001 From: xangelo Date: Thu, 13 Jul 2023 06:15:51 -0400 Subject: [PATCH] fix: prod build process + migration Since we pre-build webpack, we're just running the typescript migration and copying `public/` into `dist/`. We also tweak the migration script so that it runs ALL migrations since releases are more spread out now. --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index d059682..b420ea0 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,10 @@ "scripts": { "up": "npx prisma migrate dev --name \"init\"", "start": "pm2 start dist/server/api.js", - "build": "npx webpack && npx tsc", + "build:prod": "npx tsc", + "postbuild:prod": "cp -R public dist/", "migrate": "npx ts-node ./node_modules/knex/bin/cli.js migrate:latest", - "migrate:prod": "NODE_ENV=production npx ts-node ./node_modules/knex/bin/cli.js migrate:up", + "migrate:prod": "NODE_ENV=production npx ts-node ./node_modules/knex/bin/cli.js migrate:latest", "seed": "npx ts-node ./node_modules/knex/bin/cli.js seed:run", "seed:prod": "NODE_ENV=production npm run seed", "dev:client": "npx webpack -w", -- 2.25.1