feat(frontend): update portal layout and API environments
This commit is contained in:
@@ -5,7 +5,7 @@ import { resolve } from 'path';
|
||||
import visualizer from 'rollup-plugin-visualizer';
|
||||
import { ArcoResolver } from 'unplugin-vue-components/resolvers';
|
||||
import Components from 'unplugin-vue-components/vite';
|
||||
import { defineConfig, type PluginOption } from 'vite';
|
||||
import { defineConfig, loadEnv, type PluginOption } from 'vite';
|
||||
import compressPlugin from 'vite-plugin-compression';
|
||||
import svgLoader from 'vite-svg-loader';
|
||||
|
||||
@@ -29,6 +29,10 @@ function manualChunks(id: string) {
|
||||
export default defineConfig(({ command, mode }) => {
|
||||
const isDev = command === 'serve';
|
||||
const isReport = mode === 'report';
|
||||
const env = loadEnv(mode, process.cwd(), '');
|
||||
const apiBaseURL =
|
||||
env.VITE_API_BASE_URL ||
|
||||
`${isDev ? 'http://localhost:12426' : 'http://rest.heqiapp.com'}/heqi/delivery/v1`;
|
||||
|
||||
const plugins: PluginOption[] = [
|
||||
vue(),
|
||||
@@ -60,6 +64,9 @@ export default defineConfig(({ command, mode }) => {
|
||||
}
|
||||
|
||||
return {
|
||||
define: {
|
||||
'import.meta.env.VITE_API_BASE_URL': JSON.stringify(apiBaseURL),
|
||||
},
|
||||
plugins,
|
||||
resolve: {
|
||||
alias: [
|
||||
|
||||
Reference in New Issue
Block a user