mirror of
https://github.com/tuono-labs/tuono
synced 2026-07-25 21:02:45 -07:00
feat: create dev environment
This commit is contained in:
@@ -10,6 +10,6 @@ path = "src/lib.rs"
|
||||
|
||||
[dependencies]
|
||||
clap = { version = "4.5.4", features = ["derive"] }
|
||||
cargo-watch = "8.5.2"
|
||||
|
||||
axum_bundler = { path = "../axum_bundler" }
|
||||
tuono_bundler = { path = "../bundler"}
|
||||
|
||||
@@ -1,24 +1,23 @@
|
||||
use bundler::bundler;
|
||||
use std::path::Path;
|
||||
use std::process::{Command, Stdio};
|
||||
use std::process::Command;
|
||||
use std::thread;
|
||||
|
||||
fn spawn_vite_process() -> std::io::Result<()> {
|
||||
println!("Spawing vite process");
|
||||
let current_dir = std::env::current_dir()?;
|
||||
pub fn run() {
|
||||
let current_dir = std::env::current_dir().unwrap();
|
||||
|
||||
let vite_path = Path::new("node_modules/.bin/vite");
|
||||
let vite = current_dir.join(vite_path);
|
||||
|
||||
dbg!(&vite);
|
||||
let vite_handler = thread::spawn(move || {
|
||||
println!("Spawing vite process");
|
||||
let _ = Command::new(vite).arg("dev").output();
|
||||
});
|
||||
|
||||
let _ = Command::new(vite)
|
||||
.arg("dev")
|
||||
.stdout(Stdio::inherit())
|
||||
.output()?;
|
||||
let build_rs_handler = thread::spawn(move || {
|
||||
bundler::watch().unwrap();
|
||||
});
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn run() {
|
||||
println!("Running dev environment");
|
||||
let _ = spawn_vite_process();
|
||||
let _ = vite_handler.join();
|
||||
let _ = build_rs_handler.join();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user