global: snapshot

This commit is contained in:
nym21
2025-08-03 23:38:58 +02:00
parent f7aa9424db
commit a2f5704581
50 changed files with 818 additions and 704 deletions

View File

@@ -9,7 +9,7 @@ repository.workspace = true
[dependencies]
log = { workspace = true }
notify = "8.1.0"
notify = "8.2.0"
brk_rolldown = "0.1.1"
# brk_rolldown = { path = "../../../rolldown/crates/rolldown"}
sugar_path = "1.2.0"

View File

@@ -1,4 +1,8 @@
use std::{fs, io, path::Path, sync::Arc};
use std::{
fs, io,
path::{Path, PathBuf},
sync::Arc,
};
use brk_rolldown::{Bundler, BundlerOptions, RawMinifyOptions, SourceMapType};
use log::error;
@@ -8,7 +12,7 @@ use tokio::sync::Mutex;
const VERSION: &str = env!("CARGO_PKG_VERSION");
pub async fn bundle(websites_path: &Path, source_folder: &str, watch: bool) -> io::Result<()> {
pub async fn bundle(websites_path: &Path, source_folder: &str, watch: bool) -> io::Result<PathBuf> {
let source_path = websites_path.join(source_folder);
let dist_path = websites_path.join("dist");
@@ -72,7 +76,7 @@ pub async fn bundle(websites_path: &Path, source_folder: &str, watch: bool) -> i
write_sw();
if !watch {
return Ok(());
return Ok(dist_path);
}
tokio::spawn(async move {
@@ -127,7 +131,7 @@ pub async fn bundle(websites_path: &Path, source_folder: &str, watch: bool) -> i
watcher.start().await;
});
Ok(())
Ok(dist_path)
}
fn copy_dir_all(src: impl AsRef<Path>, dst: impl AsRef<Path>) -> io::Result<()> {