From: xangelo Date: Thu, 13 Jul 2023 10:15:51 +0000 (-0400) Subject: fix: prod build process + migration X-Git-Tag: v0.1.1~6 X-Git-Url: https://git.xangelo.ca/?a=commitdiff_plain;h=cecab786b949e1bf2c1c2db07b07d8083a83f82f;p=risinglegends.git 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. --- 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",