npm / pkgroll
pkgroll
What changed in pkgroll 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-12-05.
2 breaking5 new APIs and options1 behavior and defaults6 tooling22 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initpkgroll 236 changes
Breaking changes 2
Refuses destinations that contain source files.
Minimum Node.js support increased to v18 and above.
New APIs and options 5
pkgroll supports JSON entry points.
Adds a flag to filter package.json entry points.
pkgroll now supports import attributes with type "text" and "bytes".
Adds the --license flag.
pkgroll supports pnpm's package.yaml.
Behavior and default changes 1
Dependency externalization has improved warnings, helping developers identify dependency-related issues.
Tooling 6
TypeScript 6 is added to peerDependencies, declaring support for it.
pkgroll adds support for TypeScript 7.
pkgroll now supports TypeScript 6.
Build errors now show the import chain, helping developers trace where an error originates.
Sourcemaps are now supported for .d.ts files.
pkgroll now supports the imports map in package.json.
Fixes and other changes 22
Quotes CommonJS export annotations that cannot be written in shorthand.
Injects createRequire for every free require reference.
Keeps global type references when a bundled value shares the same name.
Restores executable entries specified with --input.bin and documents them.
Minifies JSON entries without changing their values.
Bin hashbangs no longer leak into other entries.
JSON entries continue to be watched after parse errors.
Watch mode now shuts down gracefully.
Preserves the entry-file hashbang in output.
Prevents declare global from being treated as an exported binding.
Adds a .jsx → .ts resolution fallback, so .jsx imports can resolve to .ts files.
Bare specifiers ending in .js are resolved through the exports map before pkgroll tries .ts.
Rollup builds are separated per output format to prevent TLA errors.
The plugin chain now runs importAttributes before resolveJsToTs.
Intermediate sourceMappingURL comments are stripped.
Dotted namespace syntax is now supported in .d.ts bundling.
Watch mode now detects changes to package.json entry points.
Corrects sourcemap line mappings for TypeScript files.
Fixes resolution of .js files to .ts files in external dependencies.
Fixes resolution of implicit external paths during pkgroll builds.
The resolver now prefers .js over .ts in node_modules.
Fixed wildcard pattern matching for root-level and filename patterns.