Upgrade Webpacker to version 3.0.1 (#5122)

This commit is contained in:
Yamagishi Kazutoshi 2017-09-27 21:41:54 +09:00 committed by Eugen Rochko
parent 3caf0ba923
commit 901fc48aae
7 changed files with 67 additions and 23 deletions

View file

@ -2,7 +2,6 @@
$stdout.sync = true
require "shellwords"
require "yaml"
ENV["RAILS_ENV"] ||= "development"
RAILS_ENV = ENV["RAILS_ENV"]
@ -20,9 +19,9 @@ unless File.exist?(WEBPACK_CONFIG)
exit!
end
newenv = { "NODE_PATH" => NODE_MODULES_PATH.shellescape }
cmdline = ["yarn", "run", "webpack", "--", "--config", WEBPACK_CONFIG] + ARGV
env = { "NODE_PATH" => NODE_MODULES_PATH.shellescape }
cmd = [ "#{NODE_MODULES_PATH}/.bin/webpack", "--config", WEBPACK_CONFIG ] + ARGV
Dir.chdir(APP_PATH) do
exec newenv, *cmdline
exec env, *cmd
end