diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 530d6acf5f..a727b49c71 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -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 diff --git a/frontend/src/constants/env.ts b/frontend/src/constants/env.ts index 2c5230dfcc..e0bca1d6fd 100644 --- a/frontend/src/constants/env.ts +++ b/frontend/src/constants/env.ts @@ -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, }; diff --git a/frontend/src/typings/environment.ts b/frontend/src/typings/environment.ts index c77832ce43..6293dd8ada 100644 --- a/frontend/src/typings/environment.ts +++ b/frontend/src/typings/environment.ts @@ -3,6 +3,7 @@ declare global { namespace NodeJS { interface ProcessEnv { FRONTEND_API_ENDPOINT: string | undefined; + NODE_ENV: 'development' | 'production' | 'test'; } } }