#30 Prepare for deploy. Images need to be public, added swa-cli. Defined VITE_API_URL to the env var for azure

This commit is contained in:
Dominic Villemure
2024-04-21 13:52:40 -04:00
parent d812b15c8f
commit 5d37cefec1
63 changed files with 57 additions and 36 deletions

View File

@@ -1,16 +1,24 @@
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
export default defineConfig(({ mode }) => {
// Load environment variables based on the mode
const env = loadEnv(mode, process.cwd(), '')
return {
plugins: [
vue(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
define: {
// Define a global constant __APP_ENV__ based on loaded environment variables
VITE_API_URL: JSON.stringify(env.VITE_API_URL)
}
}
})