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
- known issue:
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
- 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