From 6858a5aa51e96dc90490860044b04bc9254936ba Mon Sep 17 00:00:00 2001 From: Justin Gordon Date: Sat, 15 Nov 2025 20:22:10 -1000 Subject: [PATCH] Fix shakapacker.yml template to prevent 'Slow setup' warnings in development (#1850) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The installer was generating shakapacker.yml with compile: true in development, causing unnecessary 'Slow setup for development' warnings when using Procfiles with bin/dev that already run bin/shakapacker-dev-server or bin/shakapacker --watch. Changes: - Set compile: false in default section (inherited by development and production) - Remove compile: true from development section (inherits false from default) - Keep compile: true in test section (on-demand compilation needed for tests) - Add clarifying comments explaining when to use compile: true vs false This prevents Rails from attempting on-demand compilation when a webpack dev server is already running, eliminating confusing warnings on every page load. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../templates/base/base/config/shakapacker.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/generators/react_on_rails/templates/base/base/config/shakapacker.yml b/lib/generators/react_on_rails/templates/base/base/config/shakapacker.yml index 7ce2699e68..30e290fcbc 100644 --- a/lib/generators/react_on_rails/templates/base/base/config/shakapacker.yml +++ b/lib/generators/react_on_rails/templates/base/base/config/shakapacker.yml @@ -55,6 +55,11 @@ default: &default # https://webpack.js.org/guides/build-performance/#avoid-production-specific-tooling useContentHash: false + # On-demand compilation of packs when modified. Defaults to false. + # Set to false if using bin/shakapacker-dev-server or bin/shakapacker --watch via Procfiles. + # Set to true only in test environment for on-demand compilation. + compile: false + # Setting the asset host here will override Rails.application.config.asset_host. # Here, you can set different asset_host per environment. Note that # SHAKAPACKER_ASSET_HOST will override both configurations. @@ -72,7 +77,6 @@ default: &default development: <<: *default - compile: true compiler_strategy: mtime # Reference: https://webpack.js.org/configuration/dev-server/