Skip to content

Commit

Permalink
Run webpacker:install to update executables on bin/
Browse files Browse the repository at this point in the history
  • Loading branch information
gscarv13 committed Nov 23, 2021
1 parent e3e6b6c commit 6a024be
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 9 deletions.
5 changes: 5 additions & 0 deletions spec/dummy/.gitignore
Expand Up @@ -21,3 +21,8 @@
/public/webpack/*

/spec/examples.txt

# Webpack v6 installer additions
/yarn-error.log
yarn-debug.log*
.yarn-integrity
12 changes: 4 additions & 8 deletions spec/dummy/bin/webpack
@@ -1,19 +1,15 @@
#!/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"

APP_ROOT = File.expand_path("..", __dir__)
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
ENV["NODE_ENV"] ||= "development"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", Pathname.new(__FILE__).realpath)

APP_ROOT = File.expand_path("..", __dir__)
Dir.chdir(APP_ROOT) do
Webpacker::WebpackRunner.run(ARGV)
end
1 change: 1 addition & 0 deletions spec/dummy/bin/webpack-dev-server
Expand Up @@ -2,6 +2,7 @@

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

require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
Expand Down
18 changes: 18 additions & 0 deletions spec/dummy/bin/yarn
@@ -0,0 +1,18 @@
#!/usr/bin/env ruby

APP_ROOT = File.expand_path("..", __dir__)
Dir.chdir(APP_ROOT) do
yarn = ENV["PATH"].split(File::PATH_SEPARATOR).
select { |dir| File.expand_path(dir) != __dir__ }.
product(["yarn", "yarnpkg", "yarn.cmd", "yarn.ps1"]).
map { |dir, file| File.expand_path(file, dir) }.
find { |file| File.executable?(file) }

if yarn
exec yarn, *ARGV
else
$stderr.puts "Yarn executable was not detected in the system."
$stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
exit 1
end
end
3 changes: 3 additions & 0 deletions spec/dummy/config/initializers/assets.rb
Expand Up @@ -11,3 +11,6 @@
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
# Rails.application.config.assets.precompile += %w( search.js )

# Add node_modules folder to the asset load path.
Rails.application.config.assets.paths << Rails.root.join("node_modules")
5 changes: 4 additions & 1 deletion spec/dummy/package.json
Expand Up @@ -8,7 +8,7 @@
"private": true,
"dependencies": {
"@babel/preset-react": "^7.10.4",
"@rails/webpacker": "6.0.0-rc.6",
"@rails/webpacker": "^6.0.0-rc.6",
"babel-plugin-macros": "^3.1.0",
"babel-plugin-module-resolver": "^4.0.0",
"core-js": "3",
Expand Down Expand Up @@ -44,11 +44,14 @@
"sass-resources-loader": "^2.1.0",
"style-loader": "^3.3.1",
"url-loader": "^4.0.0",
"webpack": "^5.53.0",
"webpack-cli": "^4.8.0",
"webpack-dev-server": "^4.5.0",
"webpack-merge": "^5.1.4"
},
"devDependencies": {
"@pmmmwh/react-refresh-webpack-plugin": "0.4.2",
"@webpack-cli/serve": "^1.6.0",
"react-refresh": "^0.8.1"
},
"browser": {
Expand Down

0 comments on commit 6a024be

Please sign in to comment.