Skip to content

Commit d2cbfaa

Browse files
committed
Add a build environment sanity check
1 parent c5fca90 commit d2cbfaa

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

client/vite.config.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ import Vue from "@vitejs/plugin-vue";
55
import { defineConfig } from "vite";
66
import Vuetify, { transformAssetUrls } from "vite-plugin-vuetify";
77

8+
// Build sanity check, to ensure environment is defined;
9+
// this will not load from .env files (unless we used a different Vite syntax),
10+
// but we set VITE_APP_API_ROOT at the process level.
11+
if (!process.env.VITE_APP_API_ROOT) {
12+
throw new Error("VITE_APP_API_ROOT must be defined.");
13+
}
14+
815
const subpath = process.env.VITE_APP_SUBPATH || "/";
916

1017
export default defineConfig({
@@ -39,12 +46,6 @@ export default defineConfig({
3946
},
4047
server: {
4148
port: 8080,
42-
proxy: {
43-
"/api": {
44-
target: `http://localhost:8000`,
45-
xfwd: true,
46-
},
47-
},
4849
strictPort: true,
4950
},
5051
preview: {

0 commit comments

Comments
 (0)