File tree Expand file tree Collapse file tree 4 files changed +33
-28
lines changed
Expand file tree Collapse file tree 4 files changed +33
-28
lines changed Original file line number Diff line number Diff line change @@ -9,8 +9,7 @@ permissions:
99jobs :
1010 build-and-deploy :
1111 runs-on : ubuntu-latest
12- env :
13- VITE_BASE_URL : /solid-cockpit/
12+
1413 steps :
1514 - name : Checkout 🛎️
1615 uses : actions/checkout@v3
@@ -20,12 +19,15 @@ jobs:
2019 with :
2120 node-version : 20.x
2221 cache : npm
22+
2323 - name : Install and Build 🔧
2424 run : |
2525 yarn i
26- yarn run build
27- cd dist
28- cp index.html 404.html
26+ yarn run build --base=/solid-cockpit/
27+
28+ - name : Add 404 fallback
29+ run : cp dist/index.html dist/404.html
30+
2931 - name : Deploy 🚀
3032 uses : JamesIves/github-pages-deploy-action@releases/v4
3133 with :
Original file line number Diff line number Diff line change 77 "repository" : " https://github.com/KNowledgeOnWebScale/solid-cockpit/tree/EDC_active" ,
88 "author" : " Elias Crum" ,
99 "license" : " MIT" ,
10+ "type" : " module" ,
1011 "scripts" : {
1112 "dev" : " vite" ,
1213 "build" : " vite build" ,
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ import { useAuthStore } from "./stores/auth";
1515 * The router here allows for navigation between different functional pages of the TRIPLE App
1616 */
1717const router = createRouter ( {
18- history : createWebHistory ( '/solid-cockpit/' ) ,
18+ history : createWebHistory ( import . meta . env . BASE_URL ) ,
1919 routes : [
2020 {
2121 name : "Home" ,
Original file line number Diff line number Diff line change 1- import { defineConfig } from 'vite'
2- import vue from '@vitejs/plugin-vue'
3- import { fileURLToPath , URL } from 'node:url'
4-
1+ import { defineConfig } from "vite" ;
2+ import vue from "@vitejs/plugin-vue" ;
3+ import { fileURLToPath , URL } from "node:url" ;
54
65// https://vitejs.dev/config/
7- export default defineConfig ( {
8- plugins : [ vue ( ) ] ,
9- resolve : {
10- alias : {
11- '@' : fileURLToPath ( new URL ( './src' , import . meta. url ) )
12- }
13- } ,
14- base : process . env . VITE_BASE_URL || './' ,
15- transpileDependencies : true ,
16- build : {
17- outDir : 'dist' ,
18- } ,
19- server : {
20- headers : {
21- 'Cross-Origin-Opener-Policy' : 'same-origin' ,
22- 'Cross-Origin-Embedder-Policy' : 'require-corp' ,
6+ export default defineConfig ( ( { command } ) => {
7+ const isDev = command === "serve" ;
8+ return {
9+ plugins : [ vue ( ) ] ,
10+ resolve : {
11+ alias : {
12+ "@" : fileURLToPath ( new URL ( "./src" , import . meta. url ) ) ,
13+ } ,
14+ } ,
15+ base : isDev ? "./" : "/solid-cockpit/" ,
16+ transpileDependencies : true ,
17+ build : {
18+ outDir : "dist" ,
19+ } ,
20+ server : {
21+ headers : {
22+ "Cross-Origin-Opener-Policy" : "same-origin" ,
23+ "Cross-Origin-Embedder-Policy" : "require-corp" ,
24+ } ,
2325 } ,
24- } ,
25- } )
26+ } ;
27+ } ) ;
You can’t perform that action at this time.
0 commit comments