use change_detection::ChangeDetection; use static_files::{resource_dir, NpmBuild}; use std::{ fs::{self, copy}, path::Path, }; fn main() -> std::io::Result<()> { ChangeDetection::path("static/utils.js") .path("static/style.scss") .path("static/brass.jpeg") .path("static/package.json") .generate(); built::write_built_file().expect("Failed to acquire build-time information"); NpmBuild::new("./static").install()?.run("build-bulma")?; let dist_path = Path::new("./static/dist"); let nm_path = Path::new("./static/node_modules"); if fs::metadata(dist_path).is_err() { fs::create_dir(dist_path)?; } copy( nm_path.join("feather-icons/dist/feather-sprite.svg"), dist_path.join("feather-sprite.svg"), )?; copy( nm_path.join("htmx.org/dist/htmx.min.js"), dist_path.join("htmx.min.js"), )?; copy( nm_path.join("htmx.org/dist/ext/response-targets.js"), dist_path.join("response-targets.js"), )?; copy( nm_path.join("sweetalert2-neutral/dist/sweetalert2.min.js"), dist_path.join("sweetalert2.min.js"), )?; copy( nm_path.join("hyperscript.org/dist/_hyperscript.min.js"), dist_path.join("_hyperscript.min.js"), )?; copy( Path::new("./static/utils.js"), dist_path.join("utils.js"), )?; copy( Path::new("./static/brass.jpeg"), dist_path.join("brass.jpeg"), )?; resource_dir("./static/dist").build() }