From 4a6dd465c62a0fe57f4fa2b35fa7dd98f61f74b6 Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Wed, 30 Aug 2023 09:32:47 +1200 Subject: [PATCH] fix: don't duplicate `NODE_OPTIONS` (#353) --- lib/shakapacker/dev_server_runner.rb | 2 +- lib/shakapacker/webpack_runner.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/shakapacker/dev_server_runner.rb b/lib/shakapacker/dev_server_runner.rb index 4b91cdfc7..5133c2b34 100644 --- a/lib/shakapacker/dev_server_runner.rb +++ b/lib/shakapacker/dev_server_runner.rb @@ -84,7 +84,7 @@ def execute_cmd end if @argv.delete("--debug-shakapacker") || @argv.delete("--debug-webpacker") - env["NODE_OPTIONS"] = "#{ENV["NODE_OPTIONS"]} --inspect-brk --trace-warnings" + env["NODE_OPTIONS"] = "#{env["NODE_OPTIONS"]} --inspect-brk --trace-warnings" end cmd += ["--config", @webpack_config] diff --git a/lib/shakapacker/webpack_runner.rb b/lib/shakapacker/webpack_runner.rb index 4848e3784..08f4fae00 100644 --- a/lib/shakapacker/webpack_runner.rb +++ b/lib/shakapacker/webpack_runner.rb @@ -37,15 +37,15 @@ def run end if @argv.delete("--debug-shakapacker") || @argv.delete("--debug-webpacker") - env["NODE_OPTIONS"] = "#{ENV["NODE_OPTIONS"]} --inspect-brk" + env["NODE_OPTIONS"] = "#{env["NODE_OPTIONS"]} --inspect-brk" end if @argv.delete "--trace-deprecation" - env["NODE_OPTIONS"] = "#{ENV["NODE_OPTIONS"]} --trace-deprecation" + env["NODE_OPTIONS"] = "#{env["NODE_OPTIONS"]} --trace-deprecation" end if @argv.delete "--no-deprecation" - env["NODE_OPTIONS"] = "#{ENV["NODE_OPTIONS"]} --no-deprecation" + env["NODE_OPTIONS"] = "#{env["NODE_OPTIONS"]} --no-deprecation" end # Webpack commands are not compatible with --config option.