yarn webpack 5.0.0-beta.18

latest releases: 5.91.0, 5.90.3, 5.90.2...
3 years ago

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 the dependencies lookup (or dev/peer/optionalDependencies)
        • requiredVersion: false allows to disable this
      • 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 a requiredVersion. 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 or packageName 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.
    • module requests with tailing / in shared (like shared: ["package/"])
      • will match all module request with this prefix
      • otherwise behave like normal module requests

Bugfixes

  • Fix a bug in HMR runtime code that causes a crash with Cannot read property 'hot' of undefined.

Don't miss a new webpack release

NewReleases is sending notifications on new releases.