npm webpack 5.0.0-beta.29

latest releases: 5.96.1, 5.96.0, 5.95.0...
4 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
  • 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

Don't miss a new webpack release

NewReleases is sending notifications on new releases.