diff --git a/.gitignore b/.gitignore index 45e35b7cbf..09fcb9e861 100644 --- a/.gitignore +++ b/.gitignore @@ -52,4 +52,5 @@ yarn-error.log* /playwright/.browser/ /playwright/envs.js -**.dec** \ No newline at end of file +**.dec** +.idea diff --git a/package.json b/package.json index 7eb0abc236..a2f3575271 100644 --- a/package.json +++ b/package.json @@ -4,13 +4,13 @@ "private": false, "homepage": "https://github.com/blockscout/frontend#readme", "engines": { - "node": "20.11.0", + "node": "20.x", "npm": "10.2.4" }, "scripts": { "dev": "./tools/scripts/dev.sh", "dev:preset": "./tools/scripts/dev.preset.sh", - "build": "next build", + "build": "./tools/scripts/build-fix.sh", "build:docker": "docker build --build-arg GIT_COMMIT_SHA=$(git rev-parse --short HEAD) --build-arg GIT_TAG=$(git describe --tags --abbrev=0) -t blockscout-frontend:local ./", "start": "next start", "start:docker:local": "docker run -p 3000:3000 --env-file .env.local blockscout-frontend:local", diff --git a/tools/scripts/build-fix.sh b/tools/scripts/build-fix.sh new file mode 100755 index 0000000000..e624c2ea34 --- /dev/null +++ b/tools/scripts/build-fix.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# download assets for the running instance +dotenv \ + -e .env.development.local \ + -e .env.local \ + -e .env.development \ + -e .env \ + -- bash -c './deploy/scripts/download_assets.sh ./public/assets' + +yarn svg:build-sprite +echo "" + +# generate envs.js file and run the app +dotenv \ + -v NEXT_PUBLIC_GIT_COMMIT_SHA=1b10d15f \ + -v NEXT_PUBLIC_GIT_TAG=v1.25.0-alpha.2 \ + -e .env.secrets \ + -e .env.development.local \ + -e .env.local \ + -e .env.development \ + -e .env \ + -- bash -c './deploy/scripts/make_envs_script.sh && next build' | +pino-pretty