Skip to content

Commit

Permalink
fix: vite environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
aldy505 committed Sep 25, 2022
1 parent 4f758d3 commit a5ac1d3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion frontend/src/env.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference types="vite/client" />

interface ImportMetaEnv {
readonly API_BASE_URL: string;
readonly vite_API_BASE_URL: string;
}

interface ImportMeta {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/env.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const API_BASE_URL = import.meta.env.API_BASE_URL ?? "http://localhost:3000";
export const API_BASE_URL = import.meta.env.VITE_API_BASE_URL ?? "http://localhost:3000";
23 changes: 17 additions & 6 deletions frontend/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
{
"compilerOptions": {
"allowJs": true,
"target": "ES2017",
"target": "ES2020",
"module": "ES2020",
"lib": ["es2020", "DOM", "WebWorker"],
"lib": [
"es2020",
"DOM",
"WebWorker"
],
"jsx": "react-jsx",
"jsxImportSource": "@builder.io/qwik",
"strict": true,
Expand All @@ -13,10 +17,17 @@
"skipLibCheck": true,
"incremental": true,
"isolatedModules": true,
"types": ["node", "vite/client"],
"types": [
"node",
"vite/client"
],
"paths": {
"~/*": ["./src/*"]
"~/*": [
"./src/*"
]
}
},
"include": ["src"]
}
"include": [
"src"
]
}

0 comments on commit a5ac1d3

Please sign in to comment.