Files
actual-actualbudget-1/packages/plugins-service/bin/build-service-worker
lelemm 96ac1292f9 🐛 Fix Service Worker: New hash every build (#5928)
* New hash every build

* Add release notes for PR #5928

* trigger actions

* Changed from TS to MTS

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-10-15 13:11:54 -03:00

28 lines
724 B
Bash
Executable File

#!/bin/bash -e
cd `dirname "$0"`
ROOT=`pwd -P`
VITE_ARGS=""
DESKTOP_DIR="$ROOT"/../../desktop-client
SERVICE_WORKER_DIR="$DESKTOP_DIR"/service-worker
# Clean out previous build files
rm -f ../dist/*
rm -rf "$DESKTOP_DIR"/service-worker
if [ $NODE_ENV == 'development' ]; then
if [ "$OSTYPE" == "msys" ]; then
# Ensure symlinks are created as native Windows symlinks.
export MSYS=winsymlinks:nativestrict
fi
ln -snf "$ROOT"/../dist/ "$DESKTOP_DIR"/service-worker
fi
yarn vite build --config ../vite.config.mts --mode $NODE_ENV $VITE_ARGS
if [ $NODE_ENV == 'production' ]; then
# In production, just copy the built files
mkdir -p "$SERVICE_WORKER_DIR"
cp -r ../dist/* "$DESKTOP_DIR"/service-worker
fi