Support a "Convention" concept for the Webpack TogglePointInjection Plugin #13
TomStrepsil
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, the configuration of the webpack plugin is fiddly, and has coupled concepts. e.g.
variantGlobsand thejoinPointResolverneed to work with parity of finding a variation, and then "undoing" it to find a control module.toggleHandleris similarly coupled to thevariantGlobs, since it unpicks the matched paths.We could consider bundling all of this complexity into pre-built "Conventions", that take simplified parameters.
e.g. a
PathSegmentConvention, that could take parameters:triggerPath(or similar)featuresMapproduced. e.g.__variants__in the default example, is the "trigger path"pathSegmentCount(or similar)/<feature>/<variant>, but other examples in the repo include only a single path (e.g./language/), and there may be use-cases for morebasePathvariantGlobe.g./src/components/would result in/src/components/**/__variants__/...etc.maxDepthbasePath- e.g.1would be a single path segment/*/in the resultantvariantGlobpassed to the plugin, andInfinityperhaps could be a default, which implies a/**/globstar.Beta Was this translation helpful? Give feedback.
All reactions