Skip to content

Commit

Permalink
Use project version to specify base path for github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkibbler committed Oct 1, 2024
1 parent 1041336 commit 60549ca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Install dependencies and build
run: |
npm install
npm run build
npm run build -- --mode=github
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
Expand Down
16 changes: 10 additions & 6 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { defineConfig } from "vite";
import path from "path";
const { version } = require("./package.json");

export default defineConfig({
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
export default ({ mode }) => {
return {
base: mode === "github" ? `/v${version}/` : "./",
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
},
});
};
};

0 comments on commit 60549ca

Please sign in to comment.