diff --git a/Dockerfile b/Dockerfile index ad6030fe..63eff603 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,8 +6,8 @@ COPY .env.build .env RUN pnpm install --frozen-lockfile RUN pnpm typecheck -RUN pnpm build:highmem -# wipe node_modules for all packages +RUN NODE_OPTIONS='--max-old-space-size=4096' pnpm build:all +RUN find . -name "node_modules" -type d -prune RUN pnpm install --prod FROM node:16-alpine diff --git a/package.json b/package.json index 2837959b..8acae492 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "pull": "node scripts/setup_assets.js", "build:deps": "pnpm run -r build", "build": "rimraf build && node scripts/setup_assets.js --check && vite build", - "build:highmem": "NODE_OPTIONS='--max-old-space-size=4096' npm run build", + "build:all": "npm run build:deps && npm run build", "preview": "vite preview", "lint": "eslint src/**/*.{js,jsx,ts,tsx}", "fmt": "prettier --write 'src/**/*.{js,jsx,ts,tsx}'", diff --git a/scripts/publish.sh b/scripts/publish.sh index 90c093cf..6d0cc0f8 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -17,16 +17,19 @@ export REVOLT_SAAS=https://github.com/revoltchat/assets # Exit when any command fails set -e -# 1. Build Revite -yarn build +# 1. Make sure everything is present and up to date +pnpm i -# 2. Archive built files +# 2. Build Revite +npm run build:all + +# 3. Archive built files tar -czvf build.tar.gz dist -# 3. Upload built files +# 4. Upload built files scp build.tar.gz $REMOTE:$REMOTE_DIR/build.tar.gz rm build.tar.gz -# 4. Apply changes +# 5. Apply changes ssh $REMOTE "cd $REMOTE_DIR; tar -xvzf build.tar.gz; rm build.tar.gz; $POST_INSTALL"