Announcing Rslib 1.1
November 26, 2026

Rslib 1.1 is now available! This release adds support for generating package exports automatically and emitting type declarations with TypeScript 7.1. It also adopts Rspack's new runtime mode and cache implementation by default, and uses SWC Next to speed up declaration file parsing.
Notable changes include:
- Generate package exports
- Support for TypeScript 7.1
- New runtime mode
- New cache implementation
- Faster declaration file parsing
- Other improvements
Generate package exports
Rslib 1.1 can automatically generate the exports field in package.json, keeping package exports in sync with the build output.
Set exports: true to enable this feature. The example below builds both ESM and CommonJS for a TypeScript library with two entry points.
After the build, Rslib writes the following exports field to package.json.
See the exports configuration for more ways to use this feature.
Thanks to tsdown and its author Kevin Deng for inspiring this feature.
Support for TypeScript 7.1
Rslib supports generating type declarations with TypeScript 7.1 Beta and can use its new Content Mappers to extend type generation to more file types.
Install a mapper and register the file extensions it handles in tsconfig.json. This example assumes you have installed a CSS Modules mapper called example-css-modules-mapper, which is a placeholder package name.
When generating declarations, Rslib automatically loads the mapper to derive types from the class names in your CSS Modules.
Install TypeScript 7.1 Beta to try it:
New runtime mode
Rslib 1.1 defaults to Rspack's new runtime mode. In the original mode (runtimeMode: 'webpack'), the runtime exports a single __webpack_require__ function with several helpers attached to it. In the new mode (runtimeMode: 'rspack'), the runtime exposes the module loader, module factories, and helpers as named ESM exports. Each output chunk imports only the bindings it uses, making it easier for downstream bundlers to statically analyze the runtime and remove unused code through tree shaking.
The simplified code below shows how each mode organizes the generated runtime and the chunk that uses it.
New cache implementation
Rslib 1.1 enables Rspack's new cache implementation by default. The new implementation is designed to use less disk space, reduce cache write overhead, and make cache restoration more reliable. In Rspack's benchmarks, the cache used about 79% less disk space, and peak memory during cold builds dropped by about 16%. See the Rspack 2.3 announcement for details.
Faster declaration file parsing
Rslib 1.1 integrates @swc-next/parser and @swc-next/walker from SWC Next to parse declaration files during import path rewriting. Compared with the previous @ast-grep/napi implementation, Rslib's install size is about 10% smaller and the import path rewriting process takes about 60%–70% less time.
The table compares import path rewriting times for five published Rstack packages before and after switching parsers:
Other improvements
- Inline Wasm modules: Rslib supports using
?inlineto embed Wasm binaries in JavaScript output so they ship and load with the JavaScript file, as described in the Wasm guide. - Solid v2 support: Use
create-rslibto create Solid v2 projects. See the Solid guide. - Shorter module IDs: When
output.targetis'web', builds usecompact-hashedmodule IDs by default, reducing output size with shorter, stable IDs. - Build cache reliability: Changes to
.envfiles and Rslib upgrades now invalidate the relevant build cache, ensuring rebuilds use the latest configuration and version. - Versioning and publishing: The new publishing guide covers versioning, npm publishing, shipping Agent Skills, and GitHub Actions integration.
