From 8f5c61dabb96af2f6b8172980889738b6b8d32ce Mon Sep 17 00:00:00 2001 From: ecrum19 Date: Tue, 16 Sep 2025 10:04:37 +0200 Subject: [PATCH 1/3] added 404.html file after build step to handle gh-pages routing issues (3) --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 4f9ef9b7..b0d34ff1 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,6 @@ "repository": "https://github.com/KNowledgeOnWebScale/solid-cockpit/tree/EDC_active", "author": "Elias Crum", "license": "MIT", - "type": "module", "scripts": { "dev": "vite", "build": "vite build", From 497c35998c48262da80267f8054f0b61d6817fff Mon Sep 17 00:00:00 2001 From: ecrum19 Date: Tue, 16 Sep 2025 10:28:54 +0200 Subject: [PATCH 2/3] added 404.html file after build step to handle gh-pages routing issues (5) --- .github/workflows/main.yml | 10 ++++++++-- github-post-build-script.mjs | 10 +++++----- package.json | 1 + vite.config.js | 1 - 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 58e21ffa..40ddf8b3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,10 +19,16 @@ jobs: with: node-version: 20.x - - name: Install and Build 🔧 - run: | + - name: Install Dependencies 🔧 + run: yarn install + + - name: Build 🔧 + run: yarn run build + + - name: Post Build Actions 🛠️ + run: yarn run github-post-build env: NODE_ENV: production diff --git a/github-post-build-script.mjs b/github-post-build-script.mjs index 20cebe16..320d9085 100644 --- a/github-post-build-script.mjs +++ b/github-post-build-script.mjs @@ -1,5 +1,4 @@ -import { cpSync } from 'fs'; -import vueConfig from './vite.config.js'; +import { cpSync, mkdirSync } from 'fs'; const routes = [ "/home", @@ -10,8 +9,9 @@ const routes = [ "/privacy", ]; -const dir = vueConfig.build.outDir; -console.log(dir) +const dir = 'dist'; for (const route of routes) { - cpSync(dir + "/index.html", dir + route + "/index.html"); + const target = join(dir, route); + mkdirSync(target, { recursive: true }); + cpSync(join(dir, 'index.html'), join(target, 'index.html')); } diff --git a/package.json b/package.json index b0d34ff1..4f9ef9b7 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "repository": "https://github.com/KNowledgeOnWebScale/solid-cockpit/tree/EDC_active", "author": "Elias Crum", "license": "MIT", + "type": "module", "scripts": { "dev": "vite", "build": "vite build", diff --git a/vite.config.js b/vite.config.js index 3e0c2412..f9250457 100644 --- a/vite.config.js +++ b/vite.config.js @@ -13,7 +13,6 @@ export default defineConfig(({ command }) => { }, }, base: isDev ? "./" : "/solid-cockpit/", - transpileDependencies: true, build: { outDir: "dist", }, From 52fb66cf68f130c80dabd8867b8824d68c1b59a5 Mon Sep 17 00:00:00 2001 From: ecrum19 Date: Tue, 16 Sep 2025 10:32:45 +0200 Subject: [PATCH 3/3] please god make this work --- github-post-build-script.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/github-post-build-script.mjs b/github-post-build-script.mjs index 320d9085..3d49512e 100644 --- a/github-post-build-script.mjs +++ b/github-post-build-script.mjs @@ -1,4 +1,5 @@ import { cpSync, mkdirSync } from 'fs'; +import { join } from 'path'; const routes = [ "/home",