generated from alecodes/base-template
wip: change assets handling to vite-rs
This commit is contained in:
parent
6cf98d1f1a
commit
adbade7411
26 changed files with 761 additions and 112 deletions
37
build.rs
37
build.rs
|
|
@ -1,33 +1,8 @@
|
|||
use std::io::Write;
|
||||
use std::process::Command;
|
||||
use std::{env, io};
|
||||
|
||||
fn cmd(cmd: &mut Command) {
|
||||
let output = cmd.output().unwrap();
|
||||
|
||||
let _ = io::stdout().write_all(&output.stdout);
|
||||
if !output.status.success() {
|
||||
let _ = io::stderr().write_all(&output.stderr);
|
||||
panic!("\nFailed to run command\n");
|
||||
fn main() {
|
||||
// we only need to bundle the templates with the
|
||||
// feature is enabled.
|
||||
#[cfg(feature = "bundled")]
|
||||
{
|
||||
minijinja_embed::embed_templates!("src/templates");
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let out_dir = env::var("OUT_DIR").unwrap();
|
||||
|
||||
cmd(Command::new("bun").args([
|
||||
"run",
|
||||
"tmpl-build-and-load",
|
||||
"--outdir",
|
||||
out_dir.as_str(),
|
||||
"--globs",
|
||||
"frontend/templates/**/*.html",
|
||||
]));
|
||||
|
||||
println!("Build completed successfully!");
|
||||
|
||||
println!("cargo::rerun-if-changed=build.rs");
|
||||
println!("cargo::rerun-if-changed=package.json");
|
||||
println!("cargo::rerun-if-changed=frontend");
|
||||
println!("cargo:rerun-if-changed=migrations");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue