Add build script

This commit is contained in:
Jon Staab
2024-10-22 17:07:49 -07:00
parent 64dd608cc2
commit c585eb4361
4 changed files with 19 additions and 8 deletions
-1
View File
@@ -5,4 +5,3 @@ VITE_PLATFORM_LOGO=static/flotilla.png
VITE_PLATFORM_RELAY=
VITE_PLATFORM_ACCENT="#7161FF"
VITE_PLATFORM_DESCRIPTION="Flotilla is nostr — for communities."
# VITE_PLATFORM_LOGO=https:/pfp.nostr.build/fef7afcee6d7ceeaea54c4077f2a10b5909ed8912c45d44a8cb55b3dac1704f7.png
Executable
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
if [ -f .env ]; then
source .env
fi
if [ -f .env.local ]; then
source .env.local
fi
if [[ $VITE_PLATFORM_LOGO =~ ^https://* ]]; then
curl $VITE_PLATFORM_LOGO > static/logo.png
export VITE_PLATFORM_LOGO=static/logo.png
fi
npx pwa-assets-generator
npx vite build
+1 -1
View File
@@ -4,7 +4,7 @@
"private": true,
"scripts": {
"dev": "vite dev",
"build": "pwa-assets-generator && vite build",
"build": "./build.sh",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --check . && eslint .",
+1 -6
View File
@@ -4,12 +4,7 @@ import {defineConfig, minimalPreset as preset} from '@vite-pwa/assets-generator/
dotenv.config({path: '.env.local'})
dotenv.config({path: '.env'})
let logoPath = process.env.VITE_PLATFORM_LOGO
if (logoPath.startsWith('https://')) {
}
export default defineConfig({
preset,
images: [logoPath],
images: [process.env.VITE_PLATFORM_LOGO],
})