v5.0.0-beta.30
Pre-release
Pre-release
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
targettargetoption allows versions, e. g.target: "node10.13"ortarget: "es2020"targetallows 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
externalsPresetwith presets for externals for- node
- nwjs (deprecated)
- electronMain
- electronPreload
- electronRenderer
- web
- webAsync
- defaults choosen based on
targets
- mjs experiment is enabled by default
.mjsand.jswithtype: "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
__esModulesupport (will be added once this landed in node.js)
.cjsand.jswithtype: "commonjs"in package.json disables ESM support.wasmwithtype: "module"in package.json also makes extensions required in wasm imports
output.ecmaVersionis replaced withoutput.environmentwhich lists features used by webpack
Changes
- Stats improvements
- Hide
hashby default in stats - Hide
entrypointsin stats by default when unnecessary - Show only files count in entrypoints when there are too many files
- Hide auxiliary files for
entrypointsin 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