pub struct HtmlIntegration { /* private fields */ }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>>) -> Self
pub fn new(manifest: Box<dyn Manifest<'static>>) -> Self
Create new HtmlIntegration builder.
Takes boxed Manifest and returns HtmlIntegration.
Sourcepub fn import(self, chunk: &str) -> Self
pub fn import(self, chunk: &str) -> Self
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§
Auto 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