docs(guide): clarify manifest.json structure and valid chunk types in backend integration#21043
Closed
dileepapeiris wants to merge 7 commits intovitejs:mainfrom
Closed
docs(guide): clarify manifest.json structure and valid chunk types in backend integration#21043dileepapeiris wants to merge 7 commits intovitejs:mainfrom
dileepapeiris wants to merge 7 commits intovitejs:mainfrom
Conversation
Expanded documentation to specify the differences between JS chunks, CSS files, and asset chunks in the manifest. Added details about which fields are present for each chunk type and clarified how CSS imports are represented.
Added a note explaining that only JS chunks have an 'imports' field in the manifest, and clarified recursive import handling in code comments for better developer understanding.
Added notes explaining that the function only processes JS chunks due to the presence of the `imports` field, and clarified how CSS dependencies are accessed via the `css` field of JS chunks.
Added a 'Common Questions' section to clarify that CSS files in the manifest cannot have 'imports' or nested CSS fields, with an example of an invalid manifest entry.
Added a section explaining how CSS dependencies are represented in the manifest. CSS file paths are listed in the chunk's `css` array, not in the `imports` array, with example JSON provided for clarity.
Provides detailed instructions for manifest parsers on how to process the `imports` and `css` fields, and clarifies the structure of CSS and asset entries. This helps developers correctly interpret manifest files during backend integration.
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
Fixes #20858
Improves the Backend Integration Guide by clarifying the
manifest.jsonstructure and addressing confusion about which chunk types can have specific fields.Key Improvements
Clarified chunk type distinctions:
Added explicit documentation explaining that only JS chunks can have
imports,dynamicImports,css, andassetsfields, while CSS files and asset chunks only havefile,src, and optionallyisEntry/namefields.Enhanced processing instructions:
Updated step-by-step instructions to emphasize that CSS files and assets in the manifest do not have imports, preventing incorrect recursive processing.
Improved pseudo-implementation documentation:
Added notes to the
importedChunksfunction example clarifying that it only processes JS chunks and that CSS dependencies are accessed via thecssfield.Added “Common Questions” section:
New FAQ section addresses:
cssarray)Additional Context
The documentation now makes it clear that the hypothetical scenario in #20858 (CSS chunks with
importsand nestedcssfields) is invalid because CSS files areOutputAssettypes that don’t support these fields.This should prevent confusion for developers implementing custom backend integrations.