Skip to content

Commit cd25640

Browse files
committed
fix broken asset url
1 parent d1cff4f commit cd25640

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

.github/workflows/deploy.yml

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
- name: Build 🏗️
2222
run: npm run demo:build
2323
env:
24+
ASSET_URL: "vue3-device-detect/"
2425
NODE_ENV: production
2526

2627
- name: Deploy to GitHub Pages

vite.config.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { defineConfig } from 'vite'
22
import { resolve } from 'path'
33
import vue from '@vitejs/plugin-vue'
44

5+
const ASSET_URL = process.env.ASSET_URL || '';
6+
57
// https://vitejs.dev/config/
68
export default defineConfig(({ command, mode }) => {
79
if (mode === "prod") {
@@ -33,7 +35,7 @@ export default defineConfig(({ command, mode }) => {
3335
return {
3436
plugins: [vue()],
3537
build: {
36-
outDir: "demo"
38+
outDir: ASSET_URL + "demo"
3739
}
3840
};
3941
}

0 commit comments

Comments
 (0)