Fixati problemi di BASE_URL e .env

This commit is contained in:
2022-03-14 12:30:34 +01:00
parent 6a5b268eaa
commit 7fd95eafd5
5 changed files with 7 additions and 6 deletions
+1 -1
View File
@@ -5,9 +5,9 @@ all: setup build
.PHONY: setup
setup:
mkdir -p dist/
npm install
.PHONY: build
build:
npm install
npm run build
+1 -1
View File
@@ -5,7 +5,7 @@
"main": "index.js",
"scripts": {
"dev": "vite",
"build": "vite build --base=/posti-dm",
"build": "vite build",
"preview": "vite preview"
},
"keywords": [],
+2 -2
View File
@@ -50,7 +50,7 @@ async function login() {
return
}
location.href = '/'
location.href = `${import.meta.env.BASE_URL}`
} catch (e) {
displayErrorString(e)
}
@@ -64,7 +64,7 @@ async function main() {
const user = await getLoggedUser()
console.log(user)
if (user) {
location.href = '/'
location.href = `${import.meta.env.BASE_URL}`
}
elLoginButton.addEventListener('click', () => login())