mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
remove NODE_ENV from environmentVariablesInjectable
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
parent
f66050f1aa
commit
8667a47d44
@ -3,21 +3,16 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import nodeEnvInjectionToken from "../vars/node-env-injection-token";
|
|
||||||
|
|
||||||
const environmentVariablesInjectable = getInjectable({
|
const environmentVariablesInjectable = getInjectable({
|
||||||
id: "environment-variables",
|
id: "environment-variables",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: () => {
|
||||||
// IMPORTANT: The syntax needs to be exactly this in order to make environment variable values
|
|
||||||
// hard-coded at compile-time by Webpack.
|
|
||||||
const NODE_ENV = di.inject(nodeEnvInjectionToken);
|
|
||||||
const JEST_WORKER_ID = process.env.JEST_WORKER_ID;
|
const JEST_WORKER_ID = process.env.JEST_WORKER_ID;
|
||||||
const CICD = process.env.CICD;
|
const CICD = process.env.CICD;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
// Compile-time environment variables
|
// Compile-time environment variables
|
||||||
NODE_ENV,
|
|
||||||
JEST_WORKER_ID,
|
JEST_WORKER_ID,
|
||||||
CICD,
|
CICD,
|
||||||
|
|
||||||
|
|||||||
@ -3,13 +3,13 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import environmentVariablesInjectable from "../utils/environment-variables.injectable";
|
import nodeEnvInjectionToken from "./node-env-injection-token";
|
||||||
|
|
||||||
const isProductionInjectable = getInjectable({
|
const isProductionInjectable = getInjectable({
|
||||||
id: "is-production",
|
id: "is-production",
|
||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => {
|
||||||
const { NODE_ENV: nodeEnv } = di.inject(environmentVariablesInjectable);
|
const nodeEnv = di.inject(nodeEnvInjectionToken);
|
||||||
|
|
||||||
return nodeEnv === "production";
|
return nodeEnv === "production";
|
||||||
},
|
},
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
|
import nodeEnvInjectionToken from "../../../common/vars/node-env-injection-token";
|
||||||
import loggerInjectable from "../../../common/logger.injectable";
|
import loggerInjectable from "../../../common/logger.injectable";
|
||||||
import { onLoadOfApplicationInjectionToken } from "../../start-main-application/runnable-tokens/on-load-of-application-injection-token";
|
import { onLoadOfApplicationInjectionToken } from "../../start-main-application/runnable-tokens/on-load-of-application-injection-token";
|
||||||
|
|
||||||
@ -11,11 +12,12 @@ const setupDeveloperToolsInDevelopmentEnvironmentInjectable = getInjectable({
|
|||||||
|
|
||||||
instantiate: (di) => {
|
instantiate: (di) => {
|
||||||
const logger = di.inject(loggerInjectable);
|
const logger = di.inject(loggerInjectable);
|
||||||
|
const nodeEnv = di.inject(nodeEnvInjectionToken);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: "setup-developer-tools-in-development-environment",
|
id: "setup-developer-tools-in-development-environment",
|
||||||
run: () => {
|
run: () => {
|
||||||
if (process.env.NODE_ENV !== "development") {
|
if (nodeEnv !== "development") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user