v2.1.4
v2.1.4
View on GitHubView PackagePublished: Jul 14, 2026

Release Notes

Highlights

Faster ESM output builds

Building with output.module is now much faster. A lodash-es production build went from 503.8 ms to 161.6 ms (-67.9%).

Fine-grained import.meta parser options

module.parser.javascript.importMeta now accepts an object so each known import.meta property can be configured independently, on top of the existing true / false / 'preserve-unknown' values. Properties set to false are preserved for runtime evaluation, omitted properties keep their default behavior, and unknown properties are preserved. Both webpack-compatible keys (dirname, filename, main, url, webpack, webpackContext) and Rspack-specific keys (rspackHash, rspackPublicPath, glob, ...) are supported.

export default {
  module: {
    parser: {
      javascript: {
        importMeta: {
          // keep `import.meta.url` for runtime evaluation
          url: false,
          // keep the compile-time replacement of `import.meta.webpack`
          webpack: true,
        },
      },
    },
  },
};

Static worker URL output

module.parser.javascript.worker now accepts an object form with alias and url, alongside the existing boolean and string[] forms. With url: 'new-url-relative' and output.module enabled, Rspack emits a static new URL() expression for new Worker(new URL(..., import.meta.url)) instead of runtime code, honoring output.publicPath and output.workerPublicPath.

export default {
  output: {
    module: true,
    chunkFilename: '[name].bundle.js',
  },
  module: {
    parser: {
      javascript: {
        worker: {
          url: 'new-url-relative',
        },
      },
    },
  },
};
new Worker(new URL('./worker.js', import.meta.url));

// would become 👇
new Worker(new URL('./worker.bundle.js', import.meta.url));

What's Changed

New Features 🎉

Performance 🚀

Bug Fixes 🐞

Refactor 🔨

Other Changes

New Contributors

Full Changelog: https://github.com/web-infra-dev/rspack/compare/v2.1.3...v2.1.4