Skip to content

Commit

Permalink
Merge pull request #34 from tkzt/main
Browse files Browse the repository at this point in the history
Fixes frontend env loading problem
  • Loading branch information
tkzt authored Nov 28, 2024
2 parents e8a2ec5 + 7bf6229 commit b71047e
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions app/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,29 @@ import UnoCSS from 'unocss/vite'
import { presetUno, presetIcons } from 'unocss'
import { resolve } from 'path'
import transformerDirectives from '@unocss/transformer-directives'
import process from "node:process"
import { loadEnv } from 'vite'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), UnoCSS({
presets: [presetIcons(), presetUno()],
transformers: [transformerDirectives()],
})],
resolve: {
alias: {
'@': resolve(__dirname, 'src'),
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd())
return {
plugins: [vue(), UnoCSS({
presets: [presetIcons(), presetUno()],
transformers: [transformerDirectives()],
})],
resolve: {
alias: {
'@': resolve(__dirname, 'src'),
},
},
},
server: {
proxy: {
'^/manager': {
target: 'http://localhost:20099',
changeOrigin: true
server: {
proxy: {
'^/manager': {
target: 'http://localhost:20099',
changeOrigin: true
}
}
}
},
base: process.env.VITE_BASE ?? "/"
},
base: env.VITE_BASE ?? "/"
}
})

0 comments on commit b71047e

Please sign in to comment.