feat: add extra dist folders control and generate clientlibs for SplitChunks#145
Open
infloent wants to merge 10 commits into
Open
feat: add extra dist folders control and generate clientlibs for SplitChunks#145infloent wants to merge 10 commits into
infloent wants to merge 10 commits into
Conversation
Member
easingthemes
left a comment
There was a problem hiding this comment.
Nice feature — backward-compatible defaults hold up (verified the default-config path is preserved) and the fixtures/tests are thorough. A few correctness issues surface once the new opt-in flags are used, plus one watch-mode regression that affects the default workflow. Details inline.
added 5 commits
June 2, 2026 17:30
… split chunk clientlibs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Currently source and dist folder structure must be mirrors.
Now a source folder can not contains more than one entrypoint file of type js or scss because of AEM requirement on the dist side where each clientlib needs it’s own folder with it's own .xml, .txt files.
This will fix this limitation and allow to have multiple entrypoints in the same source folder but generate extra dist folders as required for AEM clientlibs categories.
New options
All would default to
false/[]. Existing projects would be unaffected unless they opt in.Filename-based dist folders (
config.general)sourceKey: string or string[]'clientlibs'or['clientlibs', 'publishlibs', 'authorlibs'])sourceKeyAsDistFolder: truefileNameDotSuffixesAsDistFolder: trueexcludeFileNameDotSuffixes: string[]Split chunks clientlibs (
config.clientlibs)generateSplitChunksClientlibs: true.content.xml+js.txtfor webpacksplitChunks/runtimeChunkoutput foldersThis would be independent of the filename-based flags above.
checkChunkwould also exposemodule.resource(the full file path including filename) tosplitChunkscache grouptestfunctions, making it possible to also route files by name convention into dedicated chunk groups.The idea
All files for a component live in one folder (not mandatory). One
lsreturns the complete picture of what it does and how it splits, useful for developers navigating the codebase and for AI tools that rely on directory context to understand component scope.When an AI needs context to fix or extend a component, one directory read is enough instead of correlating multiple parallel trees, which means fewer tool calls and less context consumed.
With this options
And this example source structure (not a requirement)
The generated
diststructure will be:Related Issue
Fixes: Update chokidar usage to support v4 (glob patterns removal) -> as a prerequisite.
Fixes: Flexible source vs dist folders/clientlibs management
Types of changes
Checklist: