From c015250750d74f1e16edef02359ad35926b2daa6 Mon Sep 17 00:00:00 2001 From: tree Date: Mon, 13 Feb 2023 13:37:29 +0100 Subject: [PATCH] Add static-data --- .github/workflows/gh-pages.yml | 3 +++ .gitignore | 1 + package.json | 1 + 3 files changed, 5 insertions(+) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index c42b226..a274ce6 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -25,6 +25,9 @@ jobs: - name: Install dependencies run: npm ci + - name: Generate static JSON file with data + run: npm run static-data + - name: Build run: npm run build diff --git a/.gitignore b/.gitignore index 6635cf5..00ea31b 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ node_modules !.env.example vite.config.js.timestamp-* vite.config.ts.timestamp-* +static/data.json diff --git a/package.json b/package.json index 0212e05..e97132b 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "dev": "vite dev", "build": "vite build", "preview": "vite preview", + "static-data": "node -e \"(async function () { const data=await import('./src/lib/config.js');console.log(JSON.stringify(data.default, null, 2)); })()\" > static/data.json", "lint": "prettier --plugin-search-dir . --check . && eslint .", "format": "prettier --plugin-search-dir . --write ." },