The package bundlechek is hard coding the esbuild target to 2020. This feature request has 2 goals: - replace this with 2022 - add an option (both for CLI and API) to allow the user to override this new default. - the PR subject should start with "feat(bundlecheck): "
Activity
aversini commentedon Feb 4, 2026
@cursor fix please
cursor commentedon Feb 4, 2026
I've successfully implemented the requested feature. Here's a summary of the changes:
Changes made:
Updated default esbuild target from
es2020toes2022inbundler.tsAdded new
targetoption for both CLI and API:--target/-Tflag (e.g.,bundlecheck lodash --target es2020)targetoption ingetBundleStats()andgetBundleTrend()functionsFiles modified:
defaults.ts- AddedDEFAULT_TARGET,VALID_TARGETS,isValidTarget(), andnormalizeTarget()functionsbundler.ts- AddedtargettoBundleOptionstype and used it in esbuild callsparse.ts- Added CLI flag definition and validationbundlecheck.ts- Pass target to bundle functionsindex.ts- Added target to API types and functionstrend.ts- Added target support for trend analysisREADME.md- Documented the new optiondefaults.test.ts- Added unit tests for target validationValid target values:
es2015throughes2024andesnextAll 187 tests passed (including 11 new tests for target validation). The commit has been pushed to the
cursor/bundlecheck-esbuild-target-3e3ebranch.