Move from postcompile to compile#466
Conversation
There was a problem hiding this comment.
Code Review
This PR merges the postcompile lifecycle hook into the compile script by appending && node ./scripts/build-esm.js directly to the command chain — a clean, straightforward simplification.
Inline comments: 1 discussion added
Overall Assessment: ✅ Pass
| "docs": "jsdoc --configure ./.jsdoc.json ./README.md --recurse ./src --destination ./docs", | ||
| "compile": "rm -rf ./lib/* && babel src/ -d lib/ --copy-files && rm -rf ./lib/types/tests", | ||
| "postcompile": "node ./scripts/build-esm.js", | ||
| "compile": "rm -rf ./lib/* && babel src/ -d lib/ --copy-files && rm -rf ./lib/types/tests && node ./scripts/build-esm.js", |
There was a problem hiding this comment.
Suggestion: The change is functionally correct and the intent is clear. One minor thing worth noting: npm's post* lifecycle hooks run automatically after the named script, so the old postcompile would execute whenever compile was called — including indirectly via prepublish, bundle, or pretest. By inlining it, the behavior is identical in all those call paths, so there is no functional regression.
The consolidation is a net improvement: it removes an implicit, easy-to-miss lifecycle hook and makes the full compile step explicit and visible in one place. No issues here.
There was a problem hiding this comment.
Pull request overview
This PR consolidates the ESM build step into the primary compile script so that running npm run compile performs the full build in one command (instead of relying on the postcompile hook).
Changes:
- Removed the separate
postcompilescript entry. - Appended the ESM build step (
node ./scripts/build-esm.js) to the end of thecompilescript.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.