Skip to content

Releases: web-infra-dev/rslib

v0.17.1

05 Nov 13:30
30f4279

Choose a tag to compare

What's Changed

New Features 🎉

Bug Fixes 🐞

Other Changes

Full Changelog: v0.17.0...v0.17.1

v0.17.0

30 Oct 12:00
647f4d3

Choose a tag to compare

Highlights 💡

Improved ESM output

Optimizing ESM output has long been one of the key challenges faced by Rspack. Previously, we relied on module concatenation to optimize ESM outputs, but that approach had several limitations:

  • Impure output – The generated files contained Rspack's runtime code.
  • Prone to errors – Some modules could not be correctly concatenated, leading to unexpected runtime issues.
  • Limited code-splitting support – Split bundles became complex and difficult to analyze or optimize statically.

To address these issues once and for all, we introduced an experimental plugin called EsmLibraryPlugin, purpose-built for constructing clean and efficient ESM libraries:

  • Full control over the bundling process – All modules are linked during compilation, eliminating reliance on Rspack's runtime.
  • Code-splitting support – Code after splitting can be statically analyzed and is tree-shaking friendly.

The image below compares the code splitting output before and after using this plugin — the left side shows the previous output, while the right side shows the cleaner output produced by EsmLibraryPlugin:

Rspack 1.6 ESM output diff

In Rslib, the EsmLibraryPlugin is now integrated out-of-the-box with experiments.advancedEsm enabled to generate ESM output that is high-quality, more friendly to static analysis, and supports code splitting.

export default {
  lib: [
    {
      format: 'esm',
      bundle: true,
      experiments: {
        advancedEsm: true,
      },
    },
  ],
};

Tip

Currently this option only takes effect in bundle mode when format is 'esm'.

What's Changed

New Features 🎉

  • feat: introduce experiments.advancedEsm with Rspack's EsmLibraryPlugin by @JSerFeng in #1273

Other Changes

New Contributors

Full Changelog: v0.16.1...v0.17.0

v0.16.1

23 Oct 07:27
a54d243

Choose a tag to compare

What's Changed

Bug Fixes 🐞

Other Changes

Full Changelog: v0.16.0...v0.16.1

v0.16.0

21 Oct 09:51
41820d3

Choose a tag to compare

Highlights 💡

Additional build CLI options

The Rslib build command now supports additional CLI options that take precedence over configuration file settings, and can even be used without any configuration file entirely.

For example: rslib build --entry index.ts --minify --tsconfig tsconfig.build.json.

Usage:
  $ rslib build

Options:
  -w, --watch            turn on watch mode, watch for changes and rebuild
  --entry <entry>        set entry file or pattern (repeatable)
  --dist-path <dir>      set output directory
  --bundle               enable bundle mode (use --no-bundle to disable)
  --format <format>      specify the output format (esm | cjs | umd | mf | iife)
  --syntax <syntax>      set build syntax target (repeatable)
  --target <target>      set runtime target (web | node)
  --dts                  emit declaration files (use --no-dts to disable)
  --externals <pkg>      add package to externals (repeatable)
  --minify               minify output (use --no-minify to disable)
  --clean                clean output directory before build (use --no-clean to disable)
  --auto-extension       control automatic extension redirect (use --no-auto-extension to disable)
  --auto-external        control automatic dependency externalization (use --no-auto-external to disable)
  --tsconfig <path>      use specific tsconfig (relative to project root)

What's Changed

New Features 🎉

Bug Fixes 🐞

Document 📖

Other Changes

Full Changelog: v0.15.1...v0.16.0

v0.15.1

14 Oct 07:59
0d81671

Choose a tag to compare

What's Changed

Bug Fixes 🐞

Document 📖

Other Changes

Full Changelog: v0.15.0...v0.15.1

v0.15.0

29 Sep 16:39
ff7ac33

Choose a tag to compare

Highlights 💡

Preserve JSX

Rslib supports setting the JSX runtime to 'preserve' to leave JSX syntax unchanged without transforming it, which is useful when you expect JSX to be left as is in library development.

Preserve JSX

See JSX transform - React for more details.

What's Changed

New Features 🎉

Bug Fixes 🐞

  • fix(create-rslib): drop legacy Storybook packages by @fi3ework in #1252

Document 📖

Other Changes

Full Changelog: v0.14.0...v0.15.0

v0.14.0

23 Sep 11:06
007c5f0

Choose a tag to compare

Breaking changes 🚨

Config loading

Currently, configuration files are loaded with jiti, which relies on Babel. This approach is relatively slow (at least ~70ms slower compared to native).

In Rslib v0.13.3, we introduced a new CLI option --config-loader native, which uses Node.js's native loader. This approach offers better performance and stricter behavior, but comes with certain requirements:

  • Requires Node v22.18+ with built-in TypeScript support
  • Import specifiers must include file extensions
  • When using TypeScript, package.json must set "type": "module"
  • Importing JSON requires with { type: "json" }

In Rslib v0.14.0, we adjust the default configuration loading behavior. The new default is now --config-loader auto, which:

  • First attempts to use the faster native loader
  • If that fails, it gracefully falls back to jiti for broader compatibility

This change to 'auto' as the default is part of our long-term plan to transition config loading from jiti to Node.js native.

What's Changed

New Features 🎉

Bug Fixes 🐞

Other Changes

Full Changelog: v0.13.3...v0.14.0

v0.13.3

16 Sep 11:40
eb5e508

Choose a tag to compare

What's Changed

New Features 🎉

Performance 🚀

  • perf(plugin-dts): require typescript to improve startup performance by @chenjiahan in #1224

Bug Fixes 🐞

  • fix: avoid chunk conflicts when multiple libs are present by @fi3ework in #1220

Other Changes

Full Changelog: v0.13.2...v0.13.3

v0.13.2

12 Sep 03:40
c71405e

Choose a tag to compare

What's Changed

Bug Fixes 🐞

  • fix: pin @rsbuild/core version to avoid @rspack/core 1.5.5 by @fi3ework in #1217

Other Changes

Full Changelog: v0.13.1...v0.13.2

v0.13.1

10 Sep 07:43
07dd6e2

Choose a tag to compare

What's Changed

Bug Fixes 🐞

  • fix(dts): tsgo bin path should begin with file protocol in windows by @Timeless0911 in #1211

Document 📖

Other Changes

Full Changelog: v0.13.0...v0.13.1