Skip to content

Backend Integration Guide Seems To be Missing Some Scenarios #20858

@EmperorArthur

Description

@EmperorArthur

Documentation is

  • Missing
  • Outdated
  • Confusing
  • Not sure?

Explain in Detail

This is a follow up to #16525 / #20524.

The page presumes 4 steps to load a manifest.json file, yet there seem to be edge cases which are not discussed.

Assuming the manifest file in the guide has the following additions/changes:

"_test-ABCdeFG9.css": {
    "file": "assets/test-ABCdeFG9.css",
    "imports": ["logo.svg"],
    "css": ["assets/test2-ABCdeFG0.css"]
  }
"views/foo.js": {
  "imports": ["_shared-B7PI925R.js", "_test-ABCdeFG9.css", "_shared-ChJ_j-JJ.css"],
  ...
}
  1. Is the manifest file valid?
  • If not, what exactly is invalid?
  1. How should a parser handle an imported ManifestChunk where file is of type "css"?

Your Suggestion for Changes

Add this more complicated example, and update the steps and final HTML appropriately.

Strictly reading the existing steps and pseudo code a parser would produce:

<link rel="stylesheet" href="assets/foo-5UjPuW-k.css" />
<link rel="stylesheet" href="assets/shared-ChJ_j-JJ.css" />
<link rel="stylesheet" href="assets/test2-ABCdeFG0.css" />
<script type="module" src="assets/foo-BRBmoGS9.js"></script>
<!-- optional -->
<link rel="modulepreload" href="assets/shared-B7PI925R.js" />
<link rel="modulepreload" href="assets/test-ABCdeFG9.css" />
<link rel="modulepreload" href="assets/assets/logo-BuPIv-2h.svg" />
<link rel="modulepreload" href="assets/shared-ChJ_j-JJ.css" />

Which does not seem correct.

Reproduction

https://vite.dev/guide/backend-integration.html

Steps to reproduce

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions