Add build script
This commit is contained in:
parent
64dd608cc2
commit
c585eb4361
4 changed files with 19 additions and 8 deletions
1
.env
1
.env
|
|
@ -5,4 +5,3 @@ VITE_PLATFORM_LOGO=static/flotilla.png
|
||||||
VITE_PLATFORM_RELAY=
|
VITE_PLATFORM_RELAY=
|
||||||
VITE_PLATFORM_ACCENT="#7161FF"
|
VITE_PLATFORM_ACCENT="#7161FF"
|
||||||
VITE_PLATFORM_DESCRIPTION="Flotilla is nostr — for communities."
|
VITE_PLATFORM_DESCRIPTION="Flotilla is nostr — for communities."
|
||||||
# VITE_PLATFORM_LOGO=https:/pfp.nostr.build/fef7afcee6d7ceeaea54c4077f2a10b5909ed8912c45d44a8cb55b3dac1704f7.png
|
|
||||||
|
|
|
||||||
17
build.sh
Executable file
17
build.sh
Executable 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
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite dev",
|
"dev": "vite dev",
|
||||||
"build": "pwa-assets-generator && vite build",
|
"build": "./build.sh",
|
||||||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
||||||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
||||||
"lint": "prettier --check . && eslint .",
|
"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.local'})
|
||||||
dotenv.config({path: '.env'})
|
dotenv.config({path: '.env'})
|
||||||
|
|
||||||
let logoPath = process.env.VITE_PLATFORM_LOGO
|
|
||||||
|
|
||||||
if (logoPath.startsWith('https://')) {
|
|
||||||
}
|
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
preset,
|
preset,
|
||||||
images: [logoPath],
|
images: [process.env.VITE_PLATFORM_LOGO],
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue