mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-08 23:58:15 -05:00
fix(vite): Configure Vite to use subfolder
This commit is contained in:
committed by
Adrien Poupa
parent
31ee55a113
commit
7e55115a3a
@@ -63,8 +63,12 @@ TANDOOR_PLUGINS.forEach(plugin => {
|
|||||||
routes = routes.concat(plugin.routes)
|
routes = routes.concat(plugin.routes)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const basePath = localStorage.getItem("BASE_PATH")
|
||||||
|
const pathname = basePath?.startsWith("http") ? new URL(basePath).pathname : undefined
|
||||||
|
const base = pathname === "/" ? undefined : pathname
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHistory(),
|
history: createWebHistory(base),
|
||||||
routes,
|
routes,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import {VitePWA} from "vite-plugin-pwa";
|
|||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
base: '/static/vue3/',
|
base: './',
|
||||||
plugins: [
|
plugins: [
|
||||||
vue({
|
vue({
|
||||||
template: {transformAssetUrls}
|
template: {transformAssetUrls}
|
||||||
|
|||||||
Reference in New Issue
Block a user