webpack v5.0.0-beta.30 Release Notes

Release Date: 2020-09-11 // over 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
    • 0๏ธโƒฃ 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