Function start_dev_server

Source
pub fn start_dev_server(
    absolute_root_dir: &str,
    host: &str,
    port: u16,
) -> Option<ViteProcess>
Expand description

Starts the ViteJS dev server.

Example 1 (with the included ctrlc feature enabled):

fn main() {
    #[cfg(debug_assertions)]
    let _guard = Assets::start_dev_server(true);

   // ...
}

Example 2 (using the ctrlc crate to handle Ctrl-C):

fn main() {
  #[cfg(debug_assertions)]
  let _guard = Assets::start_dev_server();

  ctrlc::try_set_handler(|| {
    #[cfg(debug_assertions)]
    Assets::stop_dev_server();
    std::process::exit(0);
 }).unwrap();
}