Add build script
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
@@ -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 .",
|
||||
|
||||
@@ -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],
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user