Merge pull request #44717 from duduribeiro/add-js-dependencies-setup-when-not-using-importmaps

Add yarn install into bin/setup when not using importmap
This commit is contained in:
Gannon McGibbon 2022-03-28 15:34:17 -04:00 committed by GitHub
commit dfd0c9e5bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -1,3 +1,9 @@
* Add JavaScript dependencies installation on bin/setup
Add `yarn install` to bin/setup when using esbuild, webpack, or rollout.
*Carlos Ribeiro*
* Use `controller_class_path` in `Rails::Generators::NamedBase#route_url` * Use `controller_class_path` in `Rails::Generators::NamedBase#route_url`
The `route_url` method now returns the correct path when generating The `route_url` method now returns the correct path when generating

View File

@ -15,6 +15,12 @@ FileUtils.chdir APP_ROOT do
puts "== Installing dependencies ==" puts "== Installing dependencies =="
system! "gem install bundler --conservative" system! "gem install bundler --conservative"
system("bundle check") || system!("bundle install") system("bundle check") || system!("bundle install")
<% if ["webpack", "esbuild", "rollup"].include?(options.javascript) -%>
# Install JavaScript dependencies
system("yarn check --check-files") || system!("yarn install")
<% end -%>
<% unless options.skip_active_record? -%> <% unless options.skip_active_record? -%>
# puts "\n== Copying sample files ==" # puts "\n== Copying sample files =="