chore: remove Babel build step and unused dependencies#63
Conversation
TypeScript alone handles all transpilation, making the Babel layer redundant. This removes @babel/core, @babel/eslint-parser, @babel/preset-env, and @rollup/plugin-babel, pruning 128 packages from node_modules. Made-with: Cursor
There was a problem hiding this comment.
Pull request overview
This PR removes the Babel transpilation layer from the Rollup build, relying on @rollup/plugin-typescript for compilation, and prunes now-unused Babel-related dev dependencies to reduce install footprint.
Changes:
- Remove
@rollup/plugin-babelusage and related preset configuration fromrollup.config.mjs. - Remove Babel-related devDependencies from
package.json. - Update
package-lock.jsonto reflect the dependency graph after pruning.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| rollup.config.mjs | Drops Babel from UMD/CJS/ESM bundling so Rollup uses only the TypeScript plugin. |
| package.json | Removes unused Babel and Rollup Babel plugin devDependencies. |
| package-lock.json | Removes Babel and associated transitive packages from the lockfile. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| plugins: [ | ||
| typescript({ | ||
| sourceMap: false | ||
| }), | ||
| babel(nonEsmOptions) | ||
| }) |
There was a problem hiding this comment.
Removing the Babel step means the UMD/CJS bundles are no longer downleveled to ES5 (previously targeted IE11) and will now reflect the TypeScript target (tsconfig.json target=es6). If ES5/legacy-browser support is intentionally dropped, consider documenting the new minimum runtime target (e.g., ES2015+) in README and/or release notes (and ensure versioning reflects a potentially breaking compatibility change).
Summary
@rollup/plugin-typescripthandles all transpilation@babel/core,@babel/eslint-parser,@babel/preset-env,@rollup/plugin-babelnode_modulesThe Babel layer was transpiling TypeScript's ES6 output down to ES5 for IE11 (EOL since June 2022) in UMD/CJS builds, and doing effectively nothing for ESM builds. With modern browser/Node targets, TypeScript alone is sufficient.
Test plan
npm run buildproduces all three outputs (CJS, ESM, UMD)npm run lintpassesnpm testpasses (21/21 tests)