Skip to content

v1.6.0-beta.1

Choose a tag to compare

@JSerFeng JSerFeng released this 22 Oct 08:44
· 191 commits to main since this release

What's Changed

Highlights πŸ’‘

EsmLibraryPlugin supports preserveModules

EsmLibraryPlugin now provides experimental support for the preserveModules feature. This allows you to maintain your source code structure as is while bundling all libraries within the node_modules folder. You can try it out using the following configuration example:

Feel free to copy and use it!

import { rspack } from "@rspack/core";
import path from 'node:path'

export default{
  entry: "./index.js",
  output: {
    chunkFormat: false,  // required, EsmLibraryPlugin handles how chunk renders 
    chunkLoading: 'import',  // required, using es module dynamic import syntax to load other chunks
  },
  optimization: {
    runtimeChunk: true,  // recommended if you have async chunks
    concatenateModules: false,  // required, EsmLibraryPlugin handles scope hoisting
  },
  plugins: [
    new rspack.experiments.EsmLibraryPlugin({
      preserveModules: path.resolve(__dirname, './src')
    })
  ],
};

Experimental supports for defer import

Rspack now supports defer import, you can enable it by experiments.deferImport = true. It is worth noting that we currently only support import defer, import.defer() will be implemented in the near future.

export default {
  experiments: {
    deferImport: true
  }
}

Performance Improvements ⚑

New Features πŸŽ‰

Bug Fixes 🐞

  • fix: should export from entry chunk for cjs reexport default by @JSerFeng in #11884
  • fix: should not cache dependency instance in DynamicEntryPlugin by @SyMind in #11888
  • fix: updated dependencies sync to persistent cache by @jerrykingxyz in #11910
  • fix: no need to create compiler instance when closing compiler by @chenjiahan in #11923
  • fix: should allow override can_inline_use in flag dependency usage plugin by @ahabhgk in #11934
  • fix: perf regression caused by is_deferred by @ahabhgk in #11944

Refactor πŸ”¨

Document Updates πŸ“–

Other Changes

New Contributors

Full Changelog: v1.6.0-beta.0...v1.6.0-beta.1