Skip to content

Commit 3dfcfdb

Browse files
authored
Add configuration documentation enhancements (#770)
This PR completes the remaining TODOs from issue #711 by improving documentation discoverability and adding a quick-reference table for common configuration options. - **Enhanced README.md Configuration section** - Added bullet points highlighting key documentation topics including `assets_bundler_config_path` to help users quickly understand what's covered in the Configuration Guide - **Added Quick Reference table** to `docs/configuration.md` - Provides an at-a-glance view of the most commonly used configuration options with their types, defaults, and descriptions - **Updated Table of Contents** - Added link to the new Quick Reference section for easy navigation ## Motivation After PR #712 added comprehensive configuration documentation and improved error messages, these enhancements make it even easier for developers to: 1. Discover the Configuration Guide from the README 2. Quickly find configuration options without reading through detailed documentation 3. Understand at a glance what each option does and its default value Closes #711
1 parent cbf7ab7 commit 3dfcfdb

2 files changed

Lines changed: 37 additions & 1 deletion

File tree

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,15 @@ At its core, Shakapacker's essential function is to:
316316

317317
### Configuration and Code
318318

319-
**📖 For a comprehensive guide to all configuration options, see [Configuration Guide](./docs/configuration.md)**
319+
**📖 For a comprehensive guide to all configuration options, see the [Configuration Guide](./docs/configuration.md)**
320+
321+
This includes documentation for:
322+
323+
- All `config/shakapacker.yml` options (including `assets_bundler_config_path`)
324+
- Environment-specific configuration
325+
- Development server settings
326+
- Build configurations (`config/shakapacker-builds.yml`)
327+
- Best practices and common patterns
320328

321329
You will need your file system to correspond to the setup of your `config/shakapacker.yml` file.
322330

docs/configuration.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ This guide covers all configuration options available in `config/shakapacker.yml
44

55
## Table of Contents
66

7+
- [Quick Reference](#quick-reference)
78
- [Basic Configuration](#basic-configuration)
89
- [Source Configuration](#source-configuration)
910
- [Output Configuration](#output-configuration)
@@ -16,6 +17,33 @@ This guide covers all configuration options available in `config/shakapacker.yml
1617
- [Environment-Specific Configuration](#environment-specific-configuration)
1718
- [Build Configurations (config/shakapacker-builds.yml)](#build-configurations-configshakapacker-buildsyml)
1819

20+
## Quick Reference
21+
22+
Common configuration options with their defaults:
23+
24+
| Option | Type | Default | Description |
25+
| ------------------------------ | ------- | --------------------------------------- | ---------------------------------------------------------- |
26+
| `assets_bundler` | string | `"webpack"` | Bundler to use: `"webpack"` or `"rspack"` |
27+
| `assets_bundler_config_path` | string | `"config/webpack"` or `"config/rspack"` | Directory containing bundler config files |
28+
| `javascript_transpiler` | string | `"swc"` or `"babel"` | Transpiler: `"swc"`, `"babel"`, or `"esbuild"` |
29+
| `source_path` | string | `"app/javascript"` | Root directory for JavaScript source files |
30+
| `source_entry_path` | string | `"packs"` | Subdirectory within `source_path` for entry points |
31+
| `nested_entries` | boolean | `true` | Discover entry points in subdirectories |
32+
| `public_output_path` | string | `"packs"` | Subdirectory within `public_root_path` for compiled assets |
33+
| `private_output_path` | string | `nil` | Directory for private server-side bundles (e.g., SSR) |
34+
| `compile` | boolean | env-specific | Compile assets on-demand when requests are made |
35+
| `cache_manifest` | boolean | `false` (dev), `true` (prod) | Cache manifest.json in memory |
36+
| `compiler_strategy` | string | `"mtime"` (dev), `"digest"` (prod) | How to determine if recompilation is needed |
37+
| `useContentHash` | boolean | `false` (dev), `true` (prod) | Include content hashes in asset filenames |
38+
| `webpack_compile_output` | boolean | `true` | Show webpack/rspack compilation output |
39+
| `shakapacker_precompile` | boolean | `true` | Include in `rails assets:precompile` |
40+
| `ensure_consistent_versioning` | boolean | `true` | Enforce gem/npm version matching |
41+
| `dev_server.host` | string | `"localhost"` | Development server host |
42+
| `dev_server.port` | number | `3035` | Development server port |
43+
| `dev_server.hmr` | boolean | `false` | Enable Hot Module Replacement |
44+
45+
For detailed explanations, examples, and additional options, see the sections below.
46+
1947
## Basic Configuration
2048

2149
### `assets_bundler`

0 commit comments

Comments
 (0)