Small CLI to zip the generated JS files of a ReScript project. Useful for sharing or inspecting diffs of compiler output.
- Config discovery: reads
rescript.jsonorbsconfig.jsonto findsources. - File selection: collects files with the configured
suffix(default:.bs.js; respectssuffixif set, e.g..res.mjs). - Output: creates a zip archive in the target project directory.
npm installnode src/RescriptGeneratedJsDiff.res.mjs <base-dir> [out-file]Examples:
# Zip generated JS in the current project (writes ./diff.zip)
node src/RescriptGeneratedJsDiff.res.mjs .
# Custom output path
node src/RescriptGeneratedJsDiff.res.mjs . ./out/generated.zip- Exits with code 1 if no files with the target suffix are found.
- To rebuild
.res.mjsfrom source, use:npm run res:build(andnpm run res:devto watch).