-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add public path and base API URL to env variables
- Loading branch information
1 parent
02627c6
commit e43dca7
Showing
3 changed files
with
26 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
VITE_BASE_PATH=/quiver-frontend/ | ||
VITE_BASE_API_URL=https://quiver-dev.sub.uni-goettingen.de/api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,33 @@ | ||
import path from 'path' | ||
import { fileURLToPath, URL } from 'node:url' | ||
|
||
import { defineConfig } from 'vite' | ||
import { defineConfig, loadEnv } from 'vite' | ||
import vue from '@vitejs/plugin-vue' | ||
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite' | ||
|
||
// https://vitejs.dev/config/ | ||
export default defineConfig({ | ||
base: '/quiver-frontend/', | ||
build: { | ||
outDir: 'dist', | ||
}, | ||
publicDir: 'assets', | ||
plugins: [ | ||
vue(), | ||
VueI18nPlugin({ | ||
// if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false` | ||
// compositionOnly: false, | ||
export default defineConfig(({ mode }) => { | ||
const env = loadEnv(mode, process.cwd(), '') | ||
return { | ||
base: env.VITE_BASE_PATH, | ||
build: { | ||
outDir: 'dist', | ||
}, | ||
publicDir: 'assets', | ||
plugins: [ | ||
vue(), | ||
VueI18nPlugin({ | ||
// if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false` | ||
// compositionOnly: false, | ||
|
||
// you need to set i18n resource including paths ! | ||
include: path.resolve(__dirname, './src/locales/**') | ||
}), | ||
], | ||
resolve: { | ||
alias: { | ||
'@': fileURLToPath(new URL('./src', import.meta.url)) | ||
// you need to set i18n resource including paths ! | ||
include: path.resolve(__dirname, './src/locales/**') | ||
}), | ||
], | ||
resolve: { | ||
alias: { | ||
'@': fileURLToPath(new URL('./src', import.meta.url)) | ||
} | ||
} | ||
} | ||
}) |