You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve server bundle path configuration documentation and validation
Adds clear documentation and automated validation to prevent configuration
mismatches between webpack and React on Rails configurations.
**Documentation Improvements:**
- Add prominent warnings in both webpack config and Rails initializer templates
- Clarify that both server_bundle_output_path settings must match
- Explain the security rationale (private directories prevent code exposure)
- Update generator templates with cross-reference comments
**Doctor Validation:**
- Add automated check that compares webpack serverWebpackConfig.js output.path
with React on Rails server_bundle_output_path configuration
- Display success message when configs are in sync
- Provide detailed warning with fix instructions when mismatch detected
- Gracefully handles missing config files or parsing errors
**Why This Matters:**
Webpack (build-time) and React on Rails (runtime) need to agree on where
server bundles are located. Misconfiguration causes SSR failures that can
be hard to debug. This change makes the requirement explicit and adds
automated validation via the doctor command.
**Technical Notes:**
- Validation runs as part of `rails react_on_rails:doctor` analysis
- Parses webpack config to extract output.path value
- Compares paths relative to Rails.root
- No breaking changes - pure documentation and tooling improvement
Related to closed PR #1808
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
0 commit comments