From: xangelo Date: Wed, 4 Dec 2024 17:46:11 +0000 (-0500) Subject: chore(build): add webpack and fix paths for build X-Git-Tag: v0.4.4~26 X-Git-Url: https://git.xangelo.ca/?a=commitdiff_plain;h=ce3b9dd522d7da60ddafe28ed4ad6333f62d3b55;p=risinglegends.git chore(build): add webpack and fix paths for build We're using typescript paths, so we need to include tsconfig-paths in the build process. Also added webpack to build to the build and simplified: ``` npm run build -> build FE + BE npm start -> start server ``` This is more in line with what DO is expecting and a more standard build process. --- diff --git a/package.json b/package.json index d8be352..e692d29 100644 --- a/package.json +++ b/package.json @@ -3,10 +3,9 @@ "private": true, "version": "0.4.3", "scripts": { - "up": "npx prisma migrate dev --name \"init\"", - "start": "pm2 start dist/server/api.js", - "build:prod": "npx tsc", - "postbuild:prod": "cp -R public dist/", + "start": "TS_NODE_BASEURL=./dist node -r tsconfig-paths/register dist/src/server/api.js", + "build": "npx tsc && npx webpack", + "postbuild": "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:latest", "seed": "npx ts-node ./node_modules/knex/bin/cli.js seed:run",