Skip to content

Commit

Permalink
Set base url
Browse files Browse the repository at this point in the history
  • Loading branch information
twastvedt committed Jan 13, 2024
1 parent a6e0719 commit 5ac0faa
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/vue-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
run: npm ci
- name: Build
run: npm run build
env:
BASE_URL: /Family-Tree-Graph/
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
Expand Down
27 changes: 15 additions & 12 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
import { fileURLToPath, URL } from 'node:url'
import { fileURLToPath, URL } from 'node:url';

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { defineConfig, UserConfig } from 'vite';
import vue from '@vitejs/plugin-vue';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
],
const config: UserConfig = {
plugins: [vue()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
}
})
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
};

if (process.env.BASE_URL) {
config.base = process.env.BASE_URL;
}

export default defineConfig(config);

0 comments on commit 5ac0faa

Please sign in to comment.