npm / pkgroll
pkgroll
What changed in pkgroll 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-22.
4 new APIs and options1 behavior and defaults6 tooling15 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initpkgroll 226 changes
New APIs and options 4
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 15
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.