|
| 1 | +# Bundler Build Configurations |
| 2 | +# Generated by: bin/shakapacker-config --init |
| 3 | +# |
| 4 | +# Run builds with: bin/shakapacker --build <name> |
| 5 | +# List builds: bin/shakapacker --list-builds |
| 6 | + |
| 7 | +builds: |
| 8 | + # =========================================================================== |
| 9 | + # DEVELOPMENT WITH HMR (Hot Module Replacement) |
| 10 | + # =========================================================================== |
| 11 | +# dev-hmr: |
| 12 | +# description: Client bundle with HMR (React Fast Refresh) |
| 13 | +# dev_server: true # Auto-delegates to bin/shakapacker-dev-server |
| 14 | +# environment: |
| 15 | +# NODE_ENV: development |
| 16 | +# RAILS_ENV: development |
| 17 | +# WEBPACK_SERVE: true |
| 18 | +# outputs: |
| 19 | +# - client |
| 20 | + |
| 21 | +# # =========================================================================== |
| 22 | +# # DEVELOPMENT (Standard - no HMR) |
| 23 | +# # =========================================================================== |
| 24 | +# dev: |
| 25 | +# description: Development client bundle |
| 26 | +# environment: |
| 27 | +# NODE_ENV: development |
| 28 | +# RAILS_ENV: development |
| 29 | +# outputs: |
| 30 | +# - client |
| 31 | + |
| 32 | +# # =========================================================================== |
| 33 | +# # PRODUCTION |
| 34 | +# # =========================================================================== |
| 35 | +# prod: |
| 36 | +# description: Production client bundle |
| 37 | +# environment: |
| 38 | +# NODE_ENV: production |
| 39 | +# RAILS_ENV: production |
| 40 | +# outputs: |
| 41 | +# - client |
| 42 | + |
| 43 | + # =========================================================================== |
| 44 | + # REACT ON RAILS WITH SSR (Uncomment to enable) |
| 45 | + # =========================================================================== |
| 46 | + # Run separate client and server bundles for server-side rendering |
| 47 | + # For more info: https://github.com/shakacode/react_on_rails |
| 48 | + |
| 49 | + dev: |
| 50 | + description: Development client bundle with HMR for SSR |
| 51 | + environment: |
| 52 | + NODE_ENV: development |
| 53 | + RAILS_ENV: development |
| 54 | + outputs: |
| 55 | + - client |
| 56 | + - server |
| 57 | + |
| 58 | + dev-hmr: |
| 59 | + description: Development client bundle with HMR for SSR |
| 60 | + dev_server: true |
| 61 | + environment: |
| 62 | + NODE_ENV: development |
| 63 | + RAILS_ENV: development |
| 64 | + WEBPACK_SERVE: "true" |
| 65 | + CLIENT_BUNDLE_ONLY: "yes" |
| 66 | + outputs: |
| 67 | + - client |
| 68 | + |
| 69 | + prod: |
| 70 | + description: Production client bundle for SSR |
| 71 | + environment: |
| 72 | + NODE_ENV: production |
| 73 | + RAILS_ENV: production |
| 74 | + outputs: |
| 75 | + - client |
| 76 | + - server |
| 77 | + |
| 78 | + # ============================================================================ |
| 79 | + # ADDITIONAL EXAMPLES |
| 80 | + # ============================================================================ |
| 81 | + |
| 82 | + # Example: Single bundle only (client or server) |
| 83 | + # dev-client-only: |
| 84 | + # description: Development client bundle only |
| 85 | + # environment: |
| 86 | + # NODE_ENV: development |
| 87 | + # RAILS_ENV: development |
| 88 | + # CLIENT_BUNDLE_ONLY: "yes" |
| 89 | + # outputs: |
| 90 | + # - client |
| 91 | + |
| 92 | + # Example: Using bundler --env flags |
| 93 | + # prod-modern: |
| 94 | + # description: Production with custom webpack/rspack --env flags |
| 95 | + # environment: |
| 96 | + # NODE_ENV: production |
| 97 | + # RAILS_ENV: production |
| 98 | + # bundler_env: |
| 99 | + # target: modern # Becomes: --env target=modern |
| 100 | + # instrumented: true # Becomes: --env instrumented |
| 101 | + # outputs: |
| 102 | + # - client |
| 103 | + # - server |
| 104 | + |
| 105 | + # Example: Variable substitution with defaults |
| 106 | + # staging: |
| 107 | + # description: Staging environment with variable substitution |
| 108 | + # environment: |
| 109 | + # NODE_ENV: production |
| 110 | + # RAILS_ENV: ${RAILS_ENV:-staging} # Use env var or default to 'staging' |
| 111 | + # outputs: |
| 112 | + # - client |
| 113 | + # - server |
| 114 | + |
| 115 | + # Example: Custom config file path (uses ${BUNDLER} substitution) |
| 116 | + # custom-config: |
| 117 | + # description: Using custom config file location |
| 118 | + # environment: |
| 119 | + # NODE_ENV: development |
| 120 | + # config: config/${BUNDLER}/${BUNDLER}.config.js |
| 121 | + # outputs: |
| 122 | + # - client |
| 123 | + # - server |
| 124 | + |
| 125 | +# ============================================================================ |
| 126 | +# USAGE EXAMPLES |
| 127 | +# ============================================================================ |
| 128 | +# |
| 129 | +# Initialize this config file: |
| 130 | +# bin/shakapacker-config --init |
| 131 | +# |
| 132 | +# List all available builds: |
| 133 | +# bin/shakapacker-config --list-builds |
| 134 | +# |
| 135 | +# Export development build configs: |
| 136 | +# bin/shakapacker-config --build=dev-hmr |
| 137 | +# Creates: rspack-dev-hmr-client.yml |
| 138 | +# |
| 139 | +# bin/shakapacker-config --build=dev |
| 140 | +# Creates: rspack-dev-client.yml, rspack-dev-server.yml |
| 141 | +# |
| 142 | +# Export production build: |
| 143 | +# bin/shakapacker-config --build=prod |
| 144 | +# Creates: rspack-prod-client.yml, rspack-prod-server.yml |
| 145 | +# |
| 146 | +# Use webpack instead of default rspack: |
| 147 | +# bin/shakapacker-config --build=prod --webpack |
| 148 | +# Creates: webpack-prod-client.yml, webpack-prod-server.yml |
| 149 | +# |
| 150 | +# Export to stdout for inspection (no files created): |
| 151 | +# bin/shakapacker-config --build=dev --stdout |
| 152 | +# |
| 153 | +# Export to custom directory: |
| 154 | +# bin/shakapacker-config --build=prod --save-dir=./debug |
| 155 | +# |
| 156 | +# Doctor mode (comprehensive troubleshooting): |
| 157 | +# bin/shakapacker-config --doctor |
| 158 | +# Creates files in: shakapacker-config-exports/ |
| 159 | +# |
0 commit comments