fix(editor): fix BASE_PATH for Vite dev mode (#4342)

* 🐛 Fix `BASE_PATH` for Vite dev mode

* don't use the string `/{{BASE_PATH}}/` as it gets replaces in build

* fix the static urls on windows

* ffs node 14

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
Iván Ovejero
2022-10-14 10:05:25 +02:00
committed by GitHub
parent 32fb298e82
commit 24288a554d
3 changed files with 6 additions and 3 deletions

View File

@@ -55,8 +55,7 @@ function getTemplatesRedirect(store: Store<IRootState>) {
const router = new Router({
mode: 'history',
// @ts-ignore
base: window.BASE_PATH ?? '/',
base: import.meta.env.DEV ? '/' : window.BASE_PATH ?? '/',
scrollBehavior(to, from, savedPosition) {
// saved position == null means the page is NOT visited from history (back button)
if (savedPosition === null && to.name === VIEWS.TEMPLATES && to.meta) {