houdini/bin/webpack

23 lines
530 B
Ruby
Executable file

#!/usr/bin/env ruby
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
ENV["NODE_ENV"] ||= "development"
require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
require "bundler/setup"
require "webpacker"
require "webpacker/webpack_runner"
def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
end
APP_ROOT = File.expand_path("..", __dir__)
Dir.chdir(APP_ROOT) do
system!("rake i18n:js:export")
Webpacker::WebpackRunner.run(ARGV)
end