2 * This utility will get rid of most
3 * false positives when parsing env
6 const parseEnvVar
= (envVar
, fallback
, mapTo
= (x
) => x
) => {
8 return mapTo(JSON
.parse(JSON
.stringify(process
.env
[envVar
])));
14 const parseBool
= (x
) => x
=== 'true' || x
=== '1' || x
=== 1;
16 const BUILD_TARGET
= parseEnvVar('BUILD_TARGET', 'chrome', String
);
17 const CLEAN_MANIFEST
= parseEnvVar('CLEAN_MANIFEST', false, parseBool
);
18 const ENV
= parseEnvVar('NODE_ENV', 'development', String
);
19 const MANIFEST_KEY
= parseEnvVar('MANIFEST_KEY', BUILD_TARGET
=== 'chrome' ? 'chrome:production' : '', String
);
20 const REDUX_DEVTOOLS_PORT
= parseEnvVar('REDUX_DEVTOOLS_PORT', 8000, parseInt
);
21 const RELEASE
= parseEnvVar('RELEASE', false, parseBool
);
22 const RESUME_FALLBACK
= parseEnvVar('RESUME_FALLBACK', false, parseBool
);
23 const RUNTIME_RELOAD
= parseEnvVar('RUNTIME_RELOAD', false, parseBool
);
24 const RUNTIME_RELOAD_PORT
= parseEnvVar('RUNTIME_RELOAD_PORT', 8089, parseInt
);
25 const WEBPACK_DEV_PORT
= parseEnvVar('WEBPACK_DEV_PORT', 8090, Number
);
26 const WEBPACK_CIRCULAR_DEPS
= parseEnvVar('WEBPACK_CIRCULAR_DEPS', false, Boolean
);
28 const HOT_MANIFEST_UPDATE
= RUNTIME_RELOAD
&& parseEnvVar('HOT_MANIFEST_UPDATE', false, parseBool
);
42 WEBPACK_CIRCULAR_DEPS
,