yarn webpack 5.0.0-beta.30

latest releases: 5.91.0, 5.90.3, 5.90.2...
3 years ago

Highlights

  • There will be a Release Candidate soon
    • See #11406 for a list of outstanding items
  • new URL("...", import.meta.url) is treated as dependency and creates an asset module
  • Worker support
    • new Worker(new URL("...", import.meta.url)) creates a WebWorker (same for new SharedWorker)
      • known issue: type: "module" doesn't work yet
    • navigator.serviceWorker.register(new URL("...", import.meta.url)) creates a ServiceWorker
  • Improved target
    • target option allows versions, e. g. target: "node10.13" or target: "es2020"
    • target allows an array of targets, e. g. target: ["web", "es2020"]

Features

  • Stats improvements
    • Group assets and modules in stats text output by default to keep within space limit
    • asset modules are enabled by default (type: "asset")
    • Put name, version, time, errors/warnings and hash in a single line as summary in the stats
  • Use output.wasmLoading (and output.workerWasmLoading) to specify the wasm loading method (similar to output.chunkLoading)
  • New option externalsPreset with presets for externals for
    • node
    • nwjs (deprecated)
    • electronMain
    • electronPreload
    • electronRenderer
    • web
    • webAsync
    • defaults choosen based on targets
  • mjs experiment is enabled by default
    • .mjs and .js with type: "module" in package.json puts ESM in strict mode
      • no CommonJs allowed
      • extensions are required in imports
      • no named exports of non-esm modules
      • no __esModule support (will be added once this landed in node.js)
    • .cjs and .js with type: "commonjs" in package.json disables ESM support
    • .wasm with type: "module" in package.json also makes extensions required in wasm imports
  • output.ecmaVersion is replaced with output.environment which lists features used by webpack

Changes

  • Stats improvements
    • Hide hash by default in stats
    • Hide entrypoints in stats by default when unnecessary
    • Show only files count in entrypoints when there are too many files
    • Hide auxiliary files for entrypoints in stats by default

Bugfixes

  • improve ASI handling to avoid Object(...) wrapping
  • fix incorrect disposing of modules when a whole chunk is removed during Hot Module Replacement

Don't miss a new webpack release

NewReleases is sending notifications on new releases.