forked from swrobel/meta-surf-forecast
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates for Rails 5.2 / Webpacker 3.2
- Loading branch information
Showing
14 changed files
with
66 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/usr/bin/env ruby | ||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) | ||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) | ||
load Gem.bin_path('bundler', 'bundle') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,21 @@ | ||
#!/usr/bin/env ruby | ||
$stdout.sync = true | ||
# frozen_string_literal: true | ||
|
||
require "shellwords" | ||
require "yaml" | ||
# | ||
# 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. | ||
# | ||
|
||
ENV["RAILS_ENV"] ||= "development" | ||
RAILS_ENV = ENV["RAILS_ENV"] | ||
bundle_binstub = File.expand_path("../bundle", __FILE__) | ||
load(bundle_binstub) if File.file?(bundle_binstub) | ||
|
||
ENV["NODE_ENV"] ||= RAILS_ENV | ||
NODE_ENV = ENV["NODE_ENV"] | ||
require "pathname" | ||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", | ||
Pathname.new(__FILE__).realpath) | ||
|
||
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") | ||
require "rubygems" | ||
require "bundler/setup" | ||
|
||
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 | ||
load Gem.bin_path("webpacker", "webpack") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,21 @@ | ||
#!/usr/bin/env ruby | ||
$stdout.sync = true | ||
# frozen_string_literal: true | ||
|
||
require "shellwords" | ||
require "yaml" | ||
# | ||
# This file was generated by Bundler. | ||
# | ||
# The application 'webpack-dev-server' is installed as part of a gem, and | ||
# this file is here to facilitate running it. | ||
# | ||
|
||
ENV["RAILS_ENV"] ||= "development" | ||
RAILS_ENV = ENV["RAILS_ENV"] | ||
bundle_binstub = File.expand_path("../bundle", __FILE__) | ||
load(bundle_binstub) if File.file?(bundle_binstub) | ||
|
||
ENV["NODE_ENV"] ||= RAILS_ENV | ||
NODE_ENV = ENV["NODE_ENV"] | ||
require "pathname" | ||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", | ||
Pathname.new(__FILE__).realpath) | ||
|
||
APP_PATH = File.expand_path("../", __dir__) | ||
CONFIG_FILE = File.join(APP_PATH, "config/webpacker.yml") | ||
NODE_MODULES_PATH = File.join(APP_PATH, "node_modules") | ||
WEBPACK_CONFIG = File.join(APP_PATH, "config/webpack/development.js") | ||
require "rubygems" | ||
require "bundler/setup" | ||
|
||
def args(key) | ||
index = ARGV.index(key) | ||
index ? ARGV[index + 1] : nil | ||
end | ||
|
||
begin | ||
dev_server = YAML.load_file(CONFIG_FILE)["development"]["dev_server"] | ||
|
||
DEV_SERVER_HOST = "http#{"s" if args('--https') || dev_server["https"]}://#{args('--host') || dev_server["host"]}:#{args('--port') || dev_server["port"]}" | ||
|
||
rescue Errno::ENOENT, NoMethodError | ||
puts "Webpack dev_server configuration not found in #{CONFIG_FILE}." | ||
puts "Please run bundle exec rails webpacker:install to install webpacker" | ||
exit! | ||
end | ||
|
||
newenv = { | ||
"NODE_PATH" => NODE_MODULES_PATH.shellescape, | ||
"ASSET_HOST" => DEV_SERVER_HOST.shellescape | ||
}.freeze | ||
|
||
cmdline = ["yarn", "run", "webpack-dev-server", "--progress", "--color", "--config", WEBPACK_CONFIG] + ARGV | ||
|
||
Dir.chdir(APP_PATH) do | ||
exec newenv, *cmdline | ||
end | ||
load Gem.bin_path("webpacker", "webpack-dev-server") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
# yarn lockfile v1 | ||
|
||
|
||
"@rails/webpacker@^3.0.2": | ||
"@rails/webpacker@^3.2.1": | ||
version "3.2.1" | ||
resolved "https://registry.yarnpkg.com/@rails/webpacker/-/webpacker-3.2.1.tgz#da7331106b93b2818c3595627c88c5c037fff3c8" | ||
dependencies: | ||
|
@@ -6438,7 +6438,7 @@ [email protected]: | |
range-parser "^1.0.3" | ||
time-stamp "^2.0.0" | ||
|
||
webpack-dev-server@^2.9.3: | ||
webpack-dev-server@^2.11.1: | ||
version "2.11.1" | ||
resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-2.11.1.tgz#6f9358a002db8403f016e336816f4485384e5ec0" | ||
dependencies: | ||
|