Skip to content

add experiments.layers #12327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 6, 2021
Merged

add experiments.layers #12327

merged 1 commit into from
Jan 6, 2021

Conversation

sokra
Copy link
Member

@sokra sokra commented Jan 4, 2021

  • add experiments.layers
  • add layers to define different module layers
  • support module layers in stats
  • add layer support for NormalModules

fixes #11466

What kind of change does this PR introduce?
feature

Did you add tests for your changes?
yes

Does this PR introduce a breaking change?
no

What needs to be documented once your changes are merged?

  • experiments.layers: true enables the experimental feature
  • entry.xxx.layer: "name-of-layer" allows to set the layer for an entrypoint
  • module.rules[].issuerLayer: RuleCondition allows to filter/match by layer of issuer
  • module.rules[].layer: "name-of-layer" allows to set the layer of an module
  • splitChunks.cacheGroups.xxx.layer allows to select modules by layer
  • externals.byLayer["name-of-layer"] allows to specify externals by layer
  • externals function has an additional argument property contextInfo which contains info about the issuer (e. g. the layer)

@webpack-bot
Copy link
Contributor

webpack-bot commented Jan 4, 2021

For maintainers only:

  • This needs to be documented (issue in webpack/webpack.js.org will be filed when merged)
  • This needs to be backported to webpack 4 (issue will be created when merged)

@sokra sokra force-pushed the feature/layer branch 3 times, most recently from 3a97ffe to a205d69 Compare January 5, 2021 10:01
add layers to define different module layers
support module layers in stats

add layer support for NormalModules

fixes #11466
@webpack-bot
Copy link
Contributor

I've created an issue to document this in webpack/webpack.js.org.

@ndelangen
Copy link

I'd be great to get a documentation page explaining how to properly use this, meaning not from an API stand-point, but from an architecture one.

for example here: https://webpack.js.org/concepts/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Need the ability for "issuer" Rule to apply to all dependencies of a top-level issuer recursively
3 participants