webpack v5.0.0-beta.29 Release Notes

Release Date: 2020-08-28 // almost 2 years ago
  • ๐Ÿ’ฅ Breaking Changes

    • ๐Ÿšš config options have moved
      • cache.managedPaths/immutablePaths -> snapshot.managedPaths/immutablePaths
      • output.hotUpdateFunction -> output.hotUpdateGlobal
      • output.jsonpFunction -> output.chunkLoadingGlobal
      • output.chunkCallbackFunction -> output.chunkLoadingGlobal

    ๐Ÿ”‹ Features

    • new RegExp() can be evaluated now, e. g. when used in require.context
    • โž• add additional logging for FileSystemInfo regarding snapshotting
    • ๐Ÿ†• new config options how snapshots are created.
      • snapshot.module: Snapshots for building of modules
      • snapshot.resolve: Snapshots for resolving of requests
      • snapshot.buildDependencies: Snapshots for build dependencies when using the persistent cache
      • snapshot.resolveBuildDependencies: Snapshots for resolving of build dependencies when using the persistent cache
    • ๐Ÿ†• new options:
      • output.chunkLoading: The method of loading chunks (methods included by default are 'jsonp' (web), 'import-scripts' (WebWorker), 'require' (sync node.js), 'async-node' (async node.js), but others might be added by plugins).
      • output.chunkFormat: The format of chunks (formats included by default are 'array-push' (web/WebWorker), 'commonjs' (node.js), but others might be added by plugins).
      • defaults are chosen based on target option
      • output.enabledChunkLoadingTypes: List of chunk loading types enabled. Will be automatically filled by webpack. Only needed when using a function as entry option and returning chunkLoading option from there.
      • entry.*.chunkLoading: Like output.chunkLoading but only for this entry.
    • ๐Ÿ”Œ output.library and output.chunkLoading now also allow any string in schema, to support adding custom types via plugins.

    ๐Ÿ”„ Changes

    • in production mode module snapshotting will use timestamp + hash mode to allow persistent caching on CI
    • 0๏ธโƒฃ output.globalObject defaults to self instead of window of web-like targets

    ๐Ÿ›  Bugfixes

    • ๐Ÿ›  fix generated code for export default function*() {}
    • ๐Ÿ‘ allow caching of modules that are not parsed because of module.noParse
    • ๐Ÿ›  fix generated code of new.target
    • avoid using require("module").builtinModules for getting node.js built-in modules
    • ๐Ÿ›  fix watching when more than 2000 directories are watched on MacOS

    ๐ŸŽ Performance

    • ๐ŸŽ Performance improvements for snapshotting
      • snapshot content other than file timestamps is deduplicated
    • lazy deserialize inner source in CachedSource
    • ๐Ÿ”€ avoid touching LazySet for cache dependencies from ModuleFactory to avoid eager merging
    • ๐ŸŽ refactor how cache dependencies are read from Modules for performance
    • store cache dependencies instead of Snapshot to avoid duplicate serialization and allow deduplication
    • create multiple files when more then 50k cache items are stored at once
    • โšก๏ธ optimize serialization of lazy deserialized content in BinaryMiddleware