-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Open
Description
A pull request by @sokra was merged and maintainers requested a documentation change.
See pull request: webpack/webpack#10992
- move script loading into separate runtime module
- attach to existing script tags
- add script external
- change defaults of ModuleFederationPlugin to var library and script remoteType
- allow using empty entry in config
- add module-federation example
What kind of change does this PR introduce?
feature
Did you add tests for your changes?
yes
Does this PR introduce a breaking change?
yes
What needs to be documented once your changes are merged?
entry: {}is now a support option for an build without configured entrypoint. e. g. when using only entrypoints generated by plugins.- When loading things with script tags, the runtime will now try to find an existing script tag that matches the
srcor has a secificdata-webpackattribute.- For chunk loadng
data-webpack="chunk-[chunkId]", for script externaldata-webpack="[global]"
- For chunk loadng
- When loadng things with script tags, the runtime will now remove the script tag once the script has been loaded.
New script external:
- The new
scriptexternalType will load a script tag and use a global afterwarts. - Syntax:
external: { xxx: ["http://example.com/script.js", "global", "property", "property"] }(properties are optional) - Shortcut syntax:
external: { xxx: "global@http://example.com/script.js" } - Any url is allowed. Public path will not be added.
- Options like
output.chunkLoadTimeoutoutput.crossOriginLoadingoutput.jsonpScriptTypewill apply to these scripts too.
Module Federation:
- The default for
ModuleFederationPlugin.remoteTypeis now:ModuleFederationPlugin.library ? ModuleFederationPlugin.library.type : "script" - The default for the
ModuleFederationPlugin.libraryis now{ type: "var", name: name }
Metadata
Metadata
Assignees
Labels
No labels