From 4dfec765f5659d2e911da67200b4b3950e1c2fb4 Mon Sep 17 00:00:00 2001 From: nsakaimbo Date: Mon, 23 Dec 2019 10:22:47 -0600 Subject: [PATCH] [package.json] Allows max_old_space_size to be overriden Behavior of heap limits in Node 12 has changed, such that the hard-coded value of max_old_space_size breaks the wp-desktop build. In addition, the way the default value has been coded to0-date makes it so this parameter could not in fact be overriden when invoked via the command line. --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 855cdff057417..c87339ef36de7 100644 --- a/package.json +++ b/package.json @@ -247,8 +247,8 @@ "build-client-fallback": "cross-env-shell BROWSERSLIST_ENV=defaults NODE_PATH=$NODE_PATH:server:client:. node $NODE_ARGS ./node_modules/webpack/bin/webpack.js --display errors-only && npm run validate-fallback-es5", "build-client-evergreen": "cross-env-shell BROWSERSLIST_ENV=evergreen NODE_PATH=$NODE_PATH:server:client:. node $NODE_ARGS ./node_modules/webpack/bin/webpack.js --display errors-only", "build-client-both": "CONCURRENT_BUILDS=2 concurrently -c cyan -n \"fallback ,evergreen\" \"npm run build-client-fallback\" \"npm run build-client-evergreen\"", - "build-client-if-prod": "node -e \"process.env.CALYPSO_ENV === 'production' && process.exit(1)\" || cross-env-shell NODE_ARGS=--max_old_space_size=8192 npm run build-client-both", - "build-client-if-desktop": "node -e \"(process.env.CALYPSO_ENV === 'desktop' || process.env.CALYPSO_ENV === 'desktop-development') && process.exit(1)\" || cross-env-shell NODE_ARGS=--max_old_space_size=8192 npm run build-client-fallback", + "build-client-if-prod": "node -e \"process.env.CALYPSO_ENV === 'production' && process.exit(1)\" || cross-env-shell NODE_ARGS=${NODE_ARGS:---max_old_space_size=8192} npm run build-client-both", + "build-client-if-desktop": "node -e \"(process.env.CALYPSO_ENV === 'desktop' || process.env.CALYPSO_ENV === 'desktop-development') && process.exit(1)\" || cross-env-shell NODE_ARGS=${NODE_ARGS:---max_old_space_size=8192} npm run build-client-fallback", "build-packages": "npx lerna run prepare --stream", "build-packages:watch": "chokidar \"./packages/**\" -i \"./packages/*/dist/**\" -i \"**.css\" -i \"**.d.ts\" --debounce 1000 --throttle 10000 -c \"npm run build-packages\"", "clean": "npm run -s clean:build && npm run -s clean:devdocs && npm run -s clean:public && npm run -s clean:packages", @@ -272,7 +272,7 @@ "start": "npm run -s build", "poststart": "run-p -s start-build-if-web start-build-if-desktop build-packages:watch", "reformat-files": "./node_modules/.bin/prettier --ignore-path .eslintignore --write \"**/*.{js,jsx,json,ts,tsx}\"", - "start-build-fallback": "cross-env-shell BROWSERSLIST_ENV=defaults NODE_PATH=$NODE_PATH:server:client:. node $NODE_ARGS --max_old_space_size=8192 build/bundle.js", + "start-build-fallback": "cross-env-shell BROWSERSLIST_ENV=defaults NODE_PATH=$NODE_PATH:server:client:. node NODE_ARGS=${NODE_ARGS:---max_old_space_size=8192} build/bundle.js", "start-build-evergreen": "cross-env-shell BROWSERSLIST_ENV=evergreen NODE_PATH=$NODE_PATH:server:client:. node $NODE_ARGS --max_old_space_size=8192 build/bundle.js", "start-build-if-desktop": "node -e \"(process.env.CALYPSO_ENV === 'desktop' || process.env.CALYPSO_ENV === 'desktop-development') && process.exit(1)\" || npm run start-build-fallback", "start-build-if-web": "node -e \"(process.env.CALYPSO_ENV !== 'desktop' && process.env.CALYPSO_ENV !== 'desktop-development') && process.exit(1)\" || npm run start-build-evergreen",