Skip to main content

react_bundle

Function react_bundle 

Source
pub fn react_bundle(bundle: &PluginAssets) -> Markup
Expand description

Renders the tags of an app bundle, in this order:

  1. <link rel="stylesheet"> for each .css file.
  2. <script defer> for each .js file (a classic script, esbuild --format=iife).
  3. <script type="module"> for each .mjs file (an ES module).

Files in a group are in logical-path order. Other files (fonts, source maps) get no tag. Each tag has the hashed URL and integrity.

Each .js and .mjs file gets a tag. Thus, do not split the build into chunks.