Bugfixes
- Remove broken postinstall script
Assets
2
Features
- Data Uri are now supported
application/json,text/javascript,application/javascript,application/node,application/wasmare supported by default as mimetype- added
Rule.mimetypeto match mimetype in rules
- [Node Chunk Loading] support runtime and entries being in different chunks (e. g. with runtimeChunk single)
- [splitChunks] defaults for
splitChunks.maxAsyncRequestsandsplitChunks.maxInitialRequestshas been increased to 30
Bugfixes
- [Chunk Loading] fix a race condition with chunk loading with multiple webpack builds on a single page with overlapping chunk ids (since beta.18)
data-webpackhas now aoutput.uniqueName+":"prefixdata-webpackis not used when nooutput.uniqueNameis specified
- [HMR] callback function in
module.hot.acceptis now parsed - [splitChunks.maxSize] chunks are not unnecessary renamed when not splitted at all
- [splitChunks.maxSize] no longer generates filenames that only differ in casing
- [Module Federation] providing modules now also works in incremental builds
- [Normalization]
stats: truenow normalizes tostats: { preset: "normal" } - [Stats] fixed as incorrectly inserted new line in the assets table
- [Jsonp Chunk Loading] fix a problem with non-js chunk in the entrypoint
Changes
- rename
output.jsonpScriptTypetooutput.scriptTypeas it's now also used for other things than jsonp (e. g. script externals)
Performance
- improvements in SplitChunksPlugin
Contributing
- yarn lockfile is now deduplicated and checked by CI
Assets
2
sokra
released this
Features
- add
scriptexternal type, which allows to load a global from a script tag - allow
entry: {}for no entries - allow magic comment in
import()for used exports/* webpackExports: "default" *//* webpackExports: ["named", "default"] */
- add support for the
"exports"field in package.json - add
resolve.restrictionsto restrict the paths a request can resolve to - ModuleFederationPlugin
- change defaults to use
scriptas remoteType by default - for module requests in shared (like
shared: ["package", "package/sub/path"])- this will apply only the references to modules that match this shared module
requiredVersionwill be extracted from package.json of the consumer automatically- new
packageNameoption allow to choose the package name for thedependencieslookup (ordev/peer/optionalDependencies) requiredVersion: falseallows to disable this
- new
- This means webpack will look for cases in your source code where your are using something like
import "package". The next package.json for the referencing module is used to determine arequiredVersion. The resolved result will be provided as shared module in the version of the package.json at the resulting location.
- for relative requests in shared (like
shared: ["./relative/path"])- will resolve relative to
context - doesn't depend on usage in the build. Always provided.
- do not use a
requiredVersionby default. Only when specified orpackageNameis specified. - This means webpack will resolve the relative request and provide the result as shared module in the version of the next package.json found at the location of the result. All requests resolving to the same file location will consume the shared module without any required version check.
- will resolve relative to
- module requests with tailing
/in shared (likeshared: ["package/"])- will match all module request with this prefix
- otherwise behave like normal module requests
- change defaults to use
Bugfixes
- Fix a bug in HMR runtime code that causes a crash with
Cannot read property 'hot' of undefined.
Assets
2
sokra
released this
Known Problems
The transitivemove-filedependency requires node >= 10.17, while webpack is intended to be >= 10.13 compatible. This temporary increases the min node version for this beta release until we found a solution to that.- Fixed, latest patch releases are >= 10.13 compatible
Features
- Using module in an ESM no longer needs the whole namespace object
- SideEffects flag can follow reexports that are partially dynamic or use a compat default
export *uses more exports info data for better exports- dynamic
export *no longer flags the default export as maybe provided - allow module concatenation even when provided exports are unknown, but used exports are known
- add
promiseexternal, which is like var but awaits the global value in a async module - add
importexternal, which usesimport()to load a native ESM - add
output.importFunctionNameto change theimport()to something else, e.g. to a polyfill. - remove some unneeded dependencies
- Module Federation
- removed scope shortcut object config for container plugins (BREAKING)
- add ability to pass advanced options to container plugins
- allow to expose an array of modules (similar to entry)
- allow to provide an array of remote locations (they act as fallback)
- await when a promise is returned by the external
- allow to expose an index module which is used when using the remote without subpath
- change exposed keys to be prefixed with
./(BREAKING) - automatically inferred keys do no longer omit leading non-word chars
- add version handling to shared modules (see #10960 for details, BREAKING)
Bugfixes
- export default no longer converts function declarations to expressions
- inline external type can also provided when using an array external.
- fixed a bug in snapshotting that caused changes to be ignored during watching
- add missing dependency for correct typings
- Persistent Caching
- DllPlugin related classes are now serializable
Dates are serializable
Changes
- merged all asset processing hooks into a new hook
processAssetswith stages - Modifications to
compilation.assetafter sealing are deprecated
Assets
2
sokra
released this
Features
- added experimental "Module Federation" - a way to load modules from separate builds into one application
- read more about the concepts here: https://github.com/webpack/changelog-v5/blob/master/guides/module-federation.md
- improve error messages when wasm experiments are disabled
- expose some webpack options types in typings
- added more details to ProgressPlugin
Bugfixes
- refactor exports info logic for CommonJs exports
- fixes a bug when using an export named
defaultin CommonJs
- fixes a bug when using an export named
- record chunk id using chunk group name and index in it
- fixes a bug when using HMR and split-chunked initial chunk
- also set parents in module graph when using non-recursive module creation
- fixes crash in harmony dependency when using this.loadModule with imports
- force upgrade terser-webpack-plugin for memory leak bugfix
- fix small non-monotony in the ProgressPlugin
- track runtime modules that need a full hash and calculate it
- fixes a bug where main.js is not updated on a HMR update
- This caused that all previous HMR updates are applied on reload
Contributing
- CI tests node.js 14 instead of 13 now
- ignore code coverage for timing dependent code
Full Changelog
Feedback
Assets
2
sokra
released this
Breaking Changes
- generate and expose typescript typings from webpack
Features
- add API to generate and process CLI arguments targeting webpack configuration
- add
__system_context__as context from System.js when using System.js as libraryTarget - add
module.hot.invalidate()API to trigger an additional hot update of this module - add bigint support for the
DefinePlugin - add bigint support for basic evaluations like maths
Bugfixes
- fix a
ReferenceError: xxx is not definedwhere some pure expression where not be removed from the code - fix handling of
extendsinclasswhen class is unused - fix incorrect schema validation for Rule conditions (include, exclude and test are not valid here)
- fix some spelling issues
- add space between value and unit in output
- fix generated code when using the
DefinePluginwith-0 - Exports from System.js externals behave correctly as ESM now
Improvements
- remove some duplication info in seralization
- make descriptions in schema more consistent in formating
Internal
- add spellcheck to CI
Full Changelog
Feedback
Assets
2
sokra
released this
Features
- add
module.hot.invalidate()to HMR API
Dependencies
- push versions for forced security updates
Assets
2
sokra
released this
Bugfixes
- update webassemblyjs dependencies for instruction update
- update mkdirp dependency for security reasons
Assets
2
sokra
released this
Changes
optimization.sideEffects,optimization.innerGraphandoptimization.usedExportsare on by default now (only production before)- Motivation: less difference between prod and dev builds, getting sideEffects benefits in dev mode.
- EnvironmentPlugin shows an error now when referenced env variable is missing and has no fallback
- Motivation: Builds should fail when an expected env variable is missing
- Remove
serveproperty from schema- Motivation: No longer needed, as this has move to a plugin
- merge all library related options into
output.libraryoutput.library: { type, name, export, auxiliaryComment, umdNamedDefine }- old options are still possible, but no longer recommended
- Motivation: more clear structure, easier sharing with
libraryin theentryoption
Features
- Allow a entry description object for advanced entrypoint configuration
entry: { main: { ... } }import: list of modulesfilename: custom filename template- Using
output.chunkFilenameis no longer recommended and onlyoutput.filenameshould be used now
- Using
dependOn: list of other entrypoint which are expected to be available on pagelibrary: library exposing
- add
percentByoption to ProgressPlugin to change percent calculation - DefinePlugin supports arrays directly now
- sync wasm support v128 now
- Update PnP support to pnp version 3 (yarn berry)
- add
output.uniqueNameoption- defaults to the package.json name in the current directory
- affects globals used for chunk communication e. g.
output.jsonpFunction
DX
- Make
Compiler/Compilation.cacheproperty read-only to make it easier to fix compat issues - ProgressPlugin stores and restores counts from last build to persistent cache for better progress calculation
- Add
Did you meanto error message for some common configuration mistakes
Bugfixes
- fix infinite loop when using
export *in a circular way - CLI has non-zero exit code when stdin is not available to ask for webpack-cli installation
- hoist exports in concatenated modules
- fixes bug with circular dependencies with non-concatenated modules
- generate valid syntax for the injected error code when modules are not found
Refactoring
- Internal refactoring of the inner graph API
- The way the default webpack configuration is created has been refactored
- New process: 1. configuration is normalized, 2. Plugins are applied, 3. configuration defaults are set
- This allows plugins to apply their own configuration defaults.
- This allows to write Configuration Preset Plugins.
- refactor the way library exposing is handled
Performance
- Increase the time logging of the core when using verbose logging
- Performance improvements
- Chunk Graph
- Persistent Caching
- SplitChunks
- Chunk
Full Changelog
Feedback
Assets
2
Bugfixes
- Disable constant replacements in
"use asm"scope - Update schema to disallow functions for
output.hotUpdateChunkFilenameas this doesn't work - Hoist exports in concatenated module to handle circular references with non-concatenated modules correctly
- Flag all modules as used in DLLs to fix missing exports