Skip to content

Commit

Permalink
Migrate to sw.js from service-worker.js
Browse files Browse the repository at this point in the history
  • Loading branch information
chunlaw committed Mar 11, 2024
1 parent c9e9fdf commit 13c5c4e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
16 changes: 8 additions & 8 deletions scripts/prebuild.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
if [ -z "$VITE__COMMIT_HASH" ];
then export VITE__COMMIT_HASH=$(git rev-parse --short HEAD);
if [ -z "$VITE_COMMIT_HASH" ];
then export VITE_COMMIT_HASH=$(git rev-parse --short HEAD);
fi;

if [ -z "$VITE__COMMIT_MESSAGE" ];
then export VITE__COMMIT_MESSAGE="$(git log -1 --pretty=format:%s $*)";
if [ -z "$VITE_COMMIT_MESSAGE" ];
then export VITE_COMMIT_MESSAGE="$(git log -1 --pretty=format:%s $*)";
fi;

if [ -z "$VITE__VERSION" ];
then export VITE__VERSION="$(node -e 'console.log(require("./package.json").version)')";
if [ -z "$VITE_VERSION" ];
then export VITE_VERSION="$(node -e 'console.log(require("./package.json").version)')";
fi;

if [ -z "$VITE__REPO_URL" ];
then export VITE__REPO_URL="$(git config --get remote.origin.url)";
if [ -z "$VITE_REPO_URL" ];
then export VITE_REPO_URL="$(git config --get remote.origin.url)";
fi;
1 change: 1 addition & 0 deletions src/service-worker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
importScripts('sw.js');

0 comments on commit 13c5c4e

Please sign in to comment.