class Webpacker::WebpackRunner
def node_modules_bin_exist?
def node_modules_bin_exist? File.exist?("#{@node_modules_bin_path}/webpack") end
def run
def run env = Webpacker::Compiler.env cmd = if node_modules_bin_exist? ["#{@node_modules_bin_path}/webpack"] else ["yarn", "webpack"] end cmd += ["--config", @webpack_config] + @argv Dir.chdir(@app_path) do Kernel.exec env, *cmd end end