diff options
author | Surinna Curtis <ekiru.0@gmail.com> | 2017-11-16 01:38:26 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-16 01:38:26 -0600 |
commit | ee560abdbe7a2caf0f7ac6137faf248bbaff9a93 (patch) | |
tree | fcd9bdb5ba49ab7a6a79590c74db858ae77b4239 /bin/webpack | |
parent | 88627fd7aa2493a6890d60a5965459e4c7fe6fe9 (diff) | |
parent | 35fbdc36f92b610e8a73e2acb220e87cf5fc83b0 (diff) |
Merge pull request #216 from glitch-soc/merge-upstream-3023725
Merge upstream at commit 3023725
Diffstat (limited to 'bin/webpack')
-rwxr-xr-x | bin/webpack | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/bin/webpack b/bin/webpack index 528233a78..9d3800c74 100755 --- a/bin/webpack +++ b/bin/webpack @@ -1,27 +1,17 @@ #!/usr/bin/env ruby -$stdout.sync = true +# frozen_string_literal: true +# +# This file was generated by Bundler. +# +# The application 'webpack' is installed as part of a gem, and +# this file is here to facilitate running it. +# -require "shellwords" +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) -ENV["RAILS_ENV"] ||= "development" -RAILS_ENV = ENV["RAILS_ENV"] +require "rubygems" +require "bundler/setup" -ENV["NODE_ENV"] ||= RAILS_ENV -NODE_ENV = ENV["NODE_ENV"] - -APP_PATH = File.expand_path("../", __dir__) -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 - -env = { "NODE_PATH" => NODE_MODULES_PATH.shellescape } -cmd = [ "#{NODE_MODULES_PATH}/.bin/webpack", "--config", WEBPACK_CONFIG ] + ARGV - -Dir.chdir(APP_PATH) do - exec env, *cmd -end +load Gem.bin_path("webpacker", "webpack") |