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:
@@ -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");
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user