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 fornew 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"
ortarget: "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
(andoutput.workerWasmLoading
) to specify the wasm loading method (similar tooutput.chunkLoading
) - ๐ New option
externalsPreset
with presets for externals for- node
- nwjs (deprecated)
- electronMain
- electronPreload
- electronRenderer
- web
- webAsync
- defaults choosen based on
target
s
- 0๏ธโฃ mjs experiment is enabled by default
.mjs
and.js
withtype: "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
withtype: "commonjs"
in package.json disables ESM support.wasm
withtype: "module"
in package.json also makes extensions required in wasm imports
output.ecmaVersion
is replaced withoutput.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
- Hide
๐ Bugfixes
- ๐ improve ASI handling to avoid
Object(...)
wrapping - ๐ fix incorrect disposing of modules when a whole chunk is removed during Hot Module Replacement
- ๐ There will be a Release Candidate soon