Skip to content

Commit

Permalink
Add yarn install into bin/setup when not using importmap
Browse files Browse the repository at this point in the history
After af7428c the yarn install
instructions was dropped from bin/setup. This commmit adds it into
the setup script again if the user is not using importmap.
  • Loading branch information
duduribeiro committed Mar 28, 2022
1 parent b589d51 commit 155b757
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions railties/CHANGELOG.md
@@ -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`

The `route_url` method now returns the correct path when generating
Expand Down
Expand Up @@ -15,6 +15,12 @@ FileUtils.chdir APP_ROOT do
puts "== Installing dependencies =="
system! "gem install bundler --conservative"
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? -%>

# puts "\n== Copying sample files =="
Expand Down

0 comments on commit 155b757

Please sign in to comment.