Commit a2bfc08
Add ReScript build step before starting development server
When bin/dev starts, webpack immediately tries to build bundles that
import ReScript components (HelloWorldReScript.res.js). However, these
.res.js files are generated by the ReScript compiler from .res source
files, and webpack fails if they don't exist yet.
Solution: Build ReScript files before starting the Procfile processes.
This ensures all .res.js files are generated before webpack starts.
Changes:
- lib/react_on_rails/dev/server_manager.rb:
- Add build_rescript_if_needed method to compile ReScript before dev server
- Check for both bsconfig.json (old) and rescript.json (new) config files
- Run yarn build:rescript if ReScript is configured
- Exit with error if ReScript build fails
Fixes webpack Module not found errors for HelloWorldReScript.res.js
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 3b9ad52 commit a2bfc08
1 file changed
+16
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
| 419 | + | |
419 | 420 | | |
420 | 421 | | |
421 | 422 | | |
422 | 423 | | |
423 | 424 | | |
424 | 425 | | |
425 | 426 | | |
| 427 | + | |
426 | 428 | | |
427 | 429 | | |
428 | 430 | | |
429 | 431 | | |
430 | 432 | | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
431 | 447 | | |
432 | 448 | | |
433 | 449 | | |
| |||
0 commit comments