Sha256: 11dbe3ad48d01ab345eb3c1878dabdb15795855512fbec1c47ee18d2c567dae7

Contents?: true

Size: 735 Bytes

Versions: 3

Compression:

Stored size: 735 Bytes

Contents

<%= shebang %>
$stdout.sync = true

require "shellwords"

ENV["RAILS_ENV"] ||= "development"
RAILS_ENV = ENV["RAILS_ENV"]

ENV["NODE_ENV"] ||= RAILS_ENV
NODE_ENV = ENV["NODE_ENV"]

APP_PATH          = File.expand_path("../", File.dirname(__FILE__))
NODE_MODULES_PATH = File.join(APP_PATH, "node_modules")
WEBPACK_CONFIG    = File.join(APP_PATH, "config/webpack/#{NODE_ENV}.js")

unless File.exist?(WEBPACK_CONFIG)
  puts "Webpack configuration not found."
  puts "Please run bundle exec rails webpacker:install to install webpacker"
  exit!
end

newenv  = { "NODE_PATH" => NODE_MODULES_PATH.shellescape }
cmdline = ["yarn", "run", "webpack", "--", "--config", WEBPACK_CONFIG] + ARGV

Dir.chdir(APP_PATH) do
  exec newenv, *cmdline
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
webpacker-legacy-0.1.2 lib/install/bin/webpack.tt
webpacker-legacy-0.1.1 lib/install/bin/webpack.tt
webpacker-legacy-0.1.0 lib/install/bin/webpack.tt