Skip to content

Commit 6858a5a

Browse files
justin808claude
andcommitted
Fix shakapacker.yml template to prevent 'Slow setup' warnings in development (#1850)
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 <[email protected]>
1 parent cbee429 commit 6858a5a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/generators/react_on_rails/templates/base/base/config/shakapacker.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ default: &default
5555
# https://webpack.js.org/guides/build-performance/#avoid-production-specific-tooling
5656
useContentHash: false
5757

58+
# On-demand compilation of packs when modified. Defaults to false.
59+
# Set to false if using bin/shakapacker-dev-server or bin/shakapacker --watch via Procfiles.
60+
# Set to true only in test environment for on-demand compilation.
61+
compile: false
62+
5863
# Setting the asset host here will override Rails.application.config.asset_host.
5964
# Here, you can set different asset_host per environment. Note that
6065
# SHAKAPACKER_ASSET_HOST will override both configurations.
@@ -72,7 +77,6 @@ default: &default
7277

7378
development:
7479
<<: *default
75-
compile: true
7680
compiler_strategy: mtime
7781

7882
# Reference: https://webpack.js.org/configuration/dev-server/

0 commit comments

Comments
 (0)