Completely updated React, fixed #11, (hopefully)
This commit is contained in:
10
goTorrentWebUI/node_modules/webpack/lib/EnvironmentPlugin.js
generated
vendored
10
goTorrentWebUI/node_modules/webpack/lib/EnvironmentPlugin.js
generated
vendored
@@ -7,6 +7,9 @@
|
||||
|
||||
const DefinePlugin = require("./DefinePlugin");
|
||||
|
||||
const needsEnvVarFix = ["8", "9"].indexOf(process.versions.node.split(".")[0]) >= 0 &&
|
||||
process.platform === "win32";
|
||||
|
||||
class EnvironmentPlugin {
|
||||
constructor(keys) {
|
||||
if(Array.isArray(keys)) {
|
||||
@@ -23,6 +26,13 @@ class EnvironmentPlugin {
|
||||
|
||||
apply(compiler) {
|
||||
const definitions = this.keys.reduce((defs, key) => {
|
||||
// TODO remove once the fix has made its way into Node 8.
|
||||
// Work around https://github.com/nodejs/node/pull/18463,
|
||||
// affecting Node 8 & 9 by performing an OS-level
|
||||
// operation that always succeeds before reading
|
||||
// environment variables:
|
||||
if(needsEnvVarFix) require("os").cpus();
|
||||
|
||||
const value = process.env[key] !== undefined ? process.env[key] : this.defaultValues[key];
|
||||
|
||||
if(value === undefined) {
|
||||
|
Reference in New Issue
Block a user