Also bundle css with bun so it busts caches

And updates the `build.rs` script so that it also builds a manifest.txt
for css files.
This commit is contained in:
2023-06-29 00:34:09 -04:00
parent ec90069c30
commit 74a205d51e
9 changed files with 53 additions and 22 deletions

View File

@@ -9,4 +9,5 @@ pub mod state;
pub mod utils;
pub mod uuid;
pub const JS_BUNDLES: &'static str = include_str!("../static/js/js_bundles.txt");
pub const JS_BUNDLES: &str = include_str!("../static/js/manifest.txt");
pub const CSS_BUNDLES: &str = include_str!("../static/css/manifest.txt");

View File

@@ -6,7 +6,7 @@ use axum::{
};
use maud::{html, Markup, DOCTYPE};
use crate::JS_BUNDLES;
use crate::{JS_BUNDLES, CSS_BUNDLES};
use crate::config::Config;
use crate::partials::header::header;
@@ -46,7 +46,9 @@ impl Layout {
@for js_bundle in JS_BUNDLES.lines() {
script type="module" src=(js_bundle) {}
}
link rel="stylesheet" href="/static/styles.css";
@for css_bundle in CSS_BUNDLES.lines() {
link rel="stylesheet" href=(css_bundle) {}
}
}
body {
(header(&self.title))