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.
variantGlobs
and thejoinPointResolver
need to work with parity of finding a variation, and then "undoing" it to find a control module.toggleHandler
is 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)featuresMap
produced. 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 morebasePath
variantGlob
e.g./src/components/
would result in/src/components/**/__variants__/...
etc.maxDepth
basePath
- e.g.1
would be a single path segment/*/
in the resultantvariantGlob
passed to the plugin, andInfinity
perhaps could be a default, which implies a/**/
globstar.Beta Was this translation helpful? Give feedback.
All reactions