close

lib.experiments

Used to enable some Rslib experimental features.

experiments.advancedEsm

Tip

experiments.advancedEsm is deprecated since Rslib v0.20 and will be removed in v1. Advanced ESM output is now the default for ESM format, so this option has no effect.

  • Type: boolean
  • Default: true

Controls whether to enable Rspack experimental ESM output. When enabled, it emits ESM output that is high-quality, more friendly to static analysis, and supports code splitting.

Info

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

If you need to disable this feature, you can set it to false:

rslib.config.ts
export default {
  lib: [
    {
      format: 'esm',
      bundle: true,
      experiments: {
        advancedEsm: false,
      },
    },
  ],
};

Version history

VersionChanges
v0.17.0Added this option
v0.19.0Changed default value from false to true
v0.20.0Deprecated this option, no longer has any effect