Skip to content

Commit

Permalink
Cache dependencies and fix base path.
Browse files Browse the repository at this point in the history
  • Loading branch information
SamTV12345 committed Jan 21, 2024
1 parent 6754eb8 commit 275f097
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache node_modules
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Setup Node.js Environment
Expand Down
4 changes: 3 additions & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ const router = createBrowserRouter(createRoutesFromElements(
<Route index element={<Navigate to="/statistics"/>}/>
<Route path="/statistics" element={<Statistics/>}/>
</Route>
))
),{
basename: import.meta.env.BASE_URL,
})


if (import.meta.env.PROD) {
Expand Down
29 changes: 15 additions & 14 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
import { defineConfig } from 'vite'
import {defineConfig} from 'vite'
import react from '@vitejs/plugin-react-swc'
import path from "path"
import svgr from "vite-plugin-svgr";

// https://vitejs.dev/config/
export default defineConfig({
plugins: [svgr(),react()],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
server:{
proxy:{
"/api": {
target: "https://ether-scan.stefans-entwicklerecke.de/api",
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ""),
plugins: [svgr(), react()],
base: '/ether-scan-ui/',
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
server: {
proxy: {
"/api": {
target: "https://ether-scan.stefans-entwicklerecke.de/api",
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ""),
},
}
}
}
})

0 comments on commit 275f097

Please sign in to comment.