npm @rspack/core 1.6.0-beta.1
v1.6.0-beta.1

23 hours ago

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

Don't miss a new core release

NewReleases is sending notifications on new releases.