Features
- add
script
external 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.restrictions
to restrict the paths a request can resolve to - ModuleFederationPlugin
- change defaults to use
script
as 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
requiredVersion
will be extracted from package.json of the consumer automatically- new
packageName
option allow to choose the package name for thedependencies
lookup (ordev/peer/optionalDependencies
) requiredVersion: false
allows 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
requiredVersion
by default. Only when specified orpackageName
is 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
.