Skip to content

Commit

Permalink
update import.meta logic
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahlessner committed Dec 19, 2024
1 parent 7246954 commit ca4afb4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
12 changes: 3 additions & 9 deletions apps/jira/jira-app/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
let LAMBDA_URI = 'https://api.jira.ctfapps.net';
let CLIENT_ID = 'XD9k9QU9VT4Rt26u6lbO3NM0fOqvvXan';

interface ImportMetaValue extends ImportMeta {
NODE_ENV?: string;
VITE_NGROK_URL?: string;
VITE_ATLASSIAN_APP_CLIENT_ID?: string;
}

if ((import.meta as ImportMetaValue).NODE_ENV === 'development') {
LAMBDA_URI = `${(import.meta as ImportMetaValue).VITE_NGROK_URL}/test`;
CLIENT_ID = (import.meta as ImportMetaValue).VITE_ATLASSIAN_APP_CLIENT_ID || '';
if (import.meta.env.DEV) {
LAMBDA_URI = `${import.meta.env.VITE_NGROK_URL}/test`;
CLIENT_ID = import.meta.env.VITE_ATLASSIAN_APP_CLIENT_ID || '';
}

const constants = {
Expand Down
3 changes: 2 additions & 1 deletion apps/jira/jira-app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"resolveJsonModule": true,
"types": [
"@types/jest",
"@types/node"
"@types/node",
"vite/client"
],
"allowJs": true,
"skipLibCheck": true,
Expand Down

0 comments on commit ca4afb4

Please sign in to comment.