lib/shakapacker/webpack_runner.rb in shakapacker-7.0.3 vs lib/shakapacker/webpack_runner.rb in shakapacker-7.1.0

- old
+ new

@@ -17,10 +17,11 @@ ].freeze def run env = Shakapacker::Compiler.env env["SHAKAPACKER_CONFIG"] = @shakapacker_config + env["NODE_OPTIONS"] = ENV["NODE_OPTIONS"] || "" cmd = if node_modules_bin_exist? ["#{@node_modules_bin_path}/webpack"] else ["yarn", "webpack"] @@ -34,18 +35,18 @@ ) ) end if @argv.delete("--debug-shakapacker") || @argv.delete("--debug-webpacker") - cmd = ["node", "--inspect-brk"] + cmd + env["NODE_OPTIONS"] = "#{env["NODE_OPTIONS"]} --inspect-brk" end if @argv.delete "--trace-deprecation" - cmd = ["node", "--trace-deprecation"] + cmd + env["NODE_OPTIONS"] = "#{env["NODE_OPTIONS"]} --trace-deprecation" end if @argv.delete "--no-deprecation" - cmd = ["node", "--no-deprecation"] + cmd + env["NODE_OPTIONS"] = "#{env["NODE_OPTIONS"]} --no-deprecation" end # Webpack commands are not compatible with --config option. if (@argv & WEBPACK_COMMANDS).empty? cmd += ["--config", @webpack_config]