Skip to content

Commit e3c6638

Browse files
authored
Merge pull request #62 from KNowledgeOnWebScale/EDC_active
added 404.html file after build step to handle gh-pages routing issue…
2 parents 31a4246 + 52fb66c commit e3c6638

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

.github/workflows/main.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,16 @@ jobs:
1919
with:
2020
node-version: 20.x
2121

22-
- name: Install and Build 🔧
23-
run: |
22+
- name: Install Dependencies 🔧
23+
run:
2424
yarn install
25+
26+
- name: Build 🔧
27+
run:
2528
yarn run build
29+
30+
- name: Post Build Actions 🛠️
31+
run:
2632
yarn run github-post-build
2733
env:
2834
NODE_ENV: production

github-post-build-script.mjs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { cpSync } from 'fs';
2-
import vueConfig from './vite.config.js';
1+
import { cpSync, mkdirSync } from 'fs';
2+
import { join } from 'path';
33

44
const routes = [
55
"/home",
@@ -10,8 +10,9 @@ const routes = [
1010
"/privacy",
1111
];
1212

13-
const dir = vueConfig.build.outDir;
14-
console.log(dir)
13+
const dir = 'dist';
1514
for (const route of routes) {
16-
cpSync(dir + "/index.html", dir + route + "/index.html");
15+
const target = join(dir, route);
16+
mkdirSync(target, { recursive: true });
17+
cpSync(join(dir, 'index.html'), join(target, 'index.html'));
1718
}

vite.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ export default defineConfig(({ command }) => {
1313
},
1414
},
1515
base: isDev ? "./" : "/solid-cockpit/",
16-
transpileDependencies: true,
1716
build: {
1817
outDir: "dist",
1918
},

0 commit comments

Comments
 (0)