Change8

v5.102.0

Breaking Changes
📦 webpackView on GitHub →
2 breaking8 features🐛 13 fixes🔧 7 symbols

Summary

This release stabilizes the topLevelAwait and layers experiments and introduces native support for 'bytes' and 'text' import attributes. It also adds a built-in extractSourceMap option to replace source-map-loader and includes several performance optimizations for snapshots and build dependencies.

⚠️ Breaking Changes

  • The topLevelAwait experiment is now stable. While not a breaking change in functionality, the configuration option experiments.topLevelAwait is no longer required.
  • The layers experiment is now stable. The configuration option experiments.layers is no longer required.

Migration Steps

  1. Remove 'experiments.topLevelAwait' from webpack.config.js as it is now enabled by default.
  2. Remove 'experiments.layers' from webpack.config.js as it is now enabled by default.
  3. Consider replacing 'source-map-loader' with the native 'extractSourceMap' option.

✨ New Features

  • Added static analysis for dynamic imports
  • Added support for 'import ... with { type: "bytes" }' to retrieve content as Uint8Array
  • Added support for 'import ... with { type: "text" }' to retrieve content as text
  • Added snapshot.contextModule to configure snapshot options for context modules
  • Added extractSourceMap option to load source maps via comments without needing source-map-loader
  • Promoted topLevelAwait experiment to stable
  • Promoted layers experiment to stable
  • Added function matcher support in rule options

🐛 Bug Fixes

  • Fixed conflicts caused by multiple concatenate modules
  • Ignore import failure during HMR update with ES modules output
  • Keep render module order consistent
  • Prevent inlining modules that have 'this' exports
  • Removed unused timeout attribute of script tag
  • Supported UMD chunk format to work in web workers
  • Improved CommonJs bundle to ES module library
  • Use es-lexer for mjs files for build dependencies
  • Fixed support __non_webpack_require__ for ES modules
  • Properly handle external modules for CSS
  • AssetsByChunkName now includes assets from chunk.auxiliaryFiles
  • Use createRequire only when output is ES module and target is node
  • Fixed various TypeScript types

🔧 Affected Symbols

snapshot.contextModuleextractSourceMapexperiments.topLevelAwaitexperiments.layers__non_webpack_require__createRequireAssetsByChunkName