1use manganis_cli_support::{AssetManifestExt, ManganisSupportGuard};
2use manganis_common::{AssetManifest, Config};
3
4fn main() {
5 use std::process::Command;
6
7 let assets_file_location = "./assets";
9 let assets_serve_location = "/assets";
11
12 Config::default()
14 .with_assets_serve_location(assets_serve_location)
15 .save();
16
17 let _guard = ManganisSupportGuard::default();
19
20 Command::new("cargo")
22 .args(["build"])
23 .spawn()
24 .unwrap()
25 .wait()
26 .unwrap();
27
28 let manifest = AssetManifest::load(Some("test-package"));
30
31 let _ = std::fs::remove_dir_all(assets_file_location);
33
34 manifest
36 .copy_static_assets_to(assets_file_location)
37 .unwrap();
38
39 let css = manifest.collect_tailwind_css(true, &mut Vec::new());
41
42 std::fs::write(format!("{}/tailwind.css", assets_file_location), css).unwrap();
44}