Skip to content

Commit 13b2d67

Browse files
committed
update how we determine ssl is available
Before ====== For some reason, our old method was sporadic ``` node --help | grep -qs "\\--openssl-legacy-provider" ``` node help was throwing a socket close error every few runs locally After ===== We are running node a new way that does not throw an exception. We changed over to back ticks to hide the output from the command But the $? is updated with the status of the system call and we determine success
1 parent f2fc155 commit 13b2d67

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

bin/webpack

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ end
2525
# If nodejs is compiled with openssl 1.1, then this flag is not available
2626
# and will fail if we hardcode it into NODE_OPTIONS
2727
#
28-
# This can be removed once we upgrade webpack as then we don't need the
29-
# flag anymore.
30-
has_legacy_openssl = system('node --help | grep -qs "\\--openssl-legacy-provider"')
28+
# This can be removed once we upgrade from webpack 4.0 to 5.0
29+
`node --openssl-legacy-provider -v`
30+
# if node supported this flag, then the command return status (i.e.: $? ) will be successful
31+
has_legacy_openssl = $?.success?
3132
node_options = "--max_old_space_size=4096"
3233
node_options << " --openssl-legacy-provider" if has_legacy_openssl
3334

0 commit comments

Comments
 (0)