feat: NODE_ENV is configured in the frontend

This commit is contained in:
Palash gupta 2022-05-10 17:18:20 +05:30
parent 53528f1045
commit ce67005d66
No known key found for this signature in database
GPG Key ID: 8FD05AE6F9150AD6
3 changed files with 6 additions and 0 deletions

View File

@ -12,6 +12,9 @@ WORKDIR /frontend
# copy the package.json to install dependencies
COPY package.json ./
# configure node_env as production
ENV NODE_ENV=production
# Install the dependencies and make the folder
RUN yarn install

View File

@ -3,4 +3,6 @@ export const ENVIRONMENT = {
process?.env?.FRONTEND_API_ENDPOINT ||
process?.env?.GITPOD_WORKSPACE_URL?.replace('://', '://8080-') ||
'',
isProduction: process?.env?.NODE_ENV === 'production',
NODE_ENV: process?.env?.NODE_ENV,
};

View File

@ -3,6 +3,7 @@ declare global {
namespace NodeJS {
interface ProcessEnv {
FRONTEND_API_ENDPOINT: string | undefined;
NODE_ENV: 'development' | 'production' | 'test';
}
}
}