pub struct JsOptions { /* private fields */ }Expand description
Configuration for crate::Server::with_js_tool: independent bundle/minify
toggles, all four combinations valid.
Unlike CSS (which discovers and concatenates every source file with no ambiguity),
JS module graphs are entry-point-driven — concatenating independent files risks
scope collisions and undefined evaluation order. bundle mode therefore requires
an explicit entry point via JsOptions::bundle_entry; without it, bundle: true
has no effect (see crate::Server::with_js_tool, which validates this at
configuration time).
Implementations§
Source§impl JsOptions
impl JsOptions
Sourcepub fn minify(self, minify: bool) -> Self
pub fn minify(self, minify: bool) -> Self
Minify JS via the configured JsTool, per file, mirroring each source file’s
relative path into the output dir (no bundling).
Sourcepub fn bundle_entry(self, entry: &Path, output_name: impl Into<String>) -> Self
pub fn bundle_entry(self, entry: &Path, output_name: impl Into<String>) -> Self
Enable single-entry-point bundling: entry is bundled (optionally minified,
per Self::minify) into <output_dir>/<output_name> via the configured
JsTool. entry must lie under a registered source folder — validated by
crate::Server::with_js_tool, not here.