Update Theme Watch Process to cover all of CSS, JS, images and fonts#1003
Update Theme Watch Process to cover all of CSS, JS, images and fonts#1003dipakmdhrm wants to merge 2 commits intomainfrom
Conversation
Replace PHP-based Robo task compilation with npm scripts that handle CSS, JS, fonts, and images. Use concurrently to watch all asset types in parallel during development. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
b9645cc to
75f7676
Compare
|
@dipakmdhrm This is nice! I have #995, but I am happy to throw it away, the only thing I'd like to double-check that the process should exit with non-zero code if CSS or JS or any other asset has a failure, so the process has a glitch, like malformed SVG, broken JS, syntax error in the style, etc. |
CSS and SVGs had proper exit logic (compile fail on error), but it wasn't so for JS. I've replaced |
|
@dipakmdhrm Thanks! Now |
Closes #324
Summary
Replaces the PHP/Robo-based theme compilation pipeline with npm scripts, simplifying the build
toolchain and enabling parallel asset watching.
Changes:
package.json: Addbuildandwatchnpm scripts for CSS, JS, fonts, and images. Addconcurrently,chokidar-cli, andimagemin-clias dev dependenciesThemeTrait.php: Remove complex PHP-based asset handling (JS minification, image optimization, SVGcompression, file watching). Delegate all of this to
npm run buildddev theme:compile: Now runsnpm install && npm run builddirectly instead ofddev robo theme:compileddev theme:watch: Now runsnpm run watchwhich usesconcurrentlyto watch CSS, JS, fonts, andimages in parallel
config.local.yaml.example/README.md: Update references fromddev robo theme:compile[-debug]to
ddev theme:compileTest plan
ddev theme:compilebuilds all assets todist/(CSS, JS, fonts, images)ddev theme:watchstarts watchers for all asset types in parallelddev restarttriggers theme compilation via the updated hookddev phpcsandddev phpstanpass (verified by pre-push hook)theme-2026-03-12_14.33.38.mp4