pub struct HtmlIntegration { /* private fields */ }Available on crate feature
html only.Expand description
HTML integration.
Builds links, preloads for specified chunks.
// Create `HtmlIntegration` struct:
let html = HtmlIntegration::new(MyViteStatic.boxed())
// import all required chunks:
.import("src/entry1.js")
.import("src/entry2.js")
// and then, you can build `String` of HTML (lines joined by '\n')
.build();
// or you can build array of lines
// .build_lines();Implementations§
Source§impl HtmlIntegration
impl HtmlIntegration
Sourcepub fn new(manifest: Box<dyn Manifest<'static>>) -> HtmlIntegration
pub fn new(manifest: Box<dyn Manifest<'static>>) -> HtmlIntegration
Create new HtmlIntegration builder.
Takes boxed Manifest and returns HtmlIntegration.
Sourcepub fn import(self, chunk: &str) -> HtmlIntegration
pub fn import(self, chunk: &str) -> HtmlIntegration
Import ManifestChunk by key (input filename).
.import("src/this-chunk.js")
.import("src/components/MyCoolComponent.tsx")
.import("src/or/some/styles.scss")Sourcepub fn build_lines(self) -> Vec<String>
pub fn build_lines(self) -> Vec<String>
Builds HTML and returns array of lines.
Trait Implementations§
Source§impl Clone for HtmlIntegration
impl Clone for HtmlIntegration
Source§fn clone(&self) -> HtmlIntegration
fn clone(&self) -> HtmlIntegration
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for HtmlIntegration
impl !Send for HtmlIntegration
impl !Sync for HtmlIntegration
impl !UnwindSafe for HtmlIntegration
impl Freeze for HtmlIntegration
impl Unpin for HtmlIntegration
impl UnsafeUnpin for HtmlIntegration
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more