feat: enable wasm_split for non-core routes
Split low-frequency routes into separate WASM chunks: - archives, tags, search, about - admin/* (dashboard, write, posts) - login, register Core reading paths (home, post detail) remain in initial bundle.
This commit is contained in:
parent
9c38ca7a16
commit
c44f37e9ec
@ -23,34 +23,34 @@ pub enum Route {
|
|||||||
Home {},
|
Home {},
|
||||||
#[route("/page/:page")]
|
#[route("/page/:page")]
|
||||||
HomePage { page: i32 },
|
HomePage { page: i32 },
|
||||||
#[route("/archives")]
|
#[route("/archives", wasm_split)]
|
||||||
Archives {},
|
Archives {},
|
||||||
#[route("/tags")]
|
#[route("/tags", wasm_split)]
|
||||||
Tags {},
|
Tags {},
|
||||||
#[route("/tags/:tag")]
|
#[route("/tags/:tag", wasm_split)]
|
||||||
TagDetail { tag: String },
|
TagDetail { tag: String },
|
||||||
#[route("/post/:slug")]
|
#[route("/post/:slug")]
|
||||||
PostDetail { slug: String },
|
PostDetail { slug: String },
|
||||||
#[route("/search")]
|
#[route("/search", wasm_split)]
|
||||||
Search {},
|
Search {},
|
||||||
#[route("/about")]
|
#[route("/about", wasm_split)]
|
||||||
About {},
|
About {},
|
||||||
#[end_layout]
|
#[end_layout]
|
||||||
|
|
||||||
#[nest("/admin")]
|
#[nest("/admin")]
|
||||||
#[layout(AdminLayout)]
|
#[layout(AdminLayout)]
|
||||||
#[route("/")]
|
#[route("/", wasm_split)]
|
||||||
Admin {},
|
Admin {},
|
||||||
#[route("/write")]
|
#[route("/write", wasm_split)]
|
||||||
Write {},
|
Write {},
|
||||||
#[route("/posts")]
|
#[route("/posts", wasm_split)]
|
||||||
Posts {},
|
Posts {},
|
||||||
#[end_layout]
|
#[end_layout]
|
||||||
#[end_nest]
|
#[end_nest]
|
||||||
|
|
||||||
#[route("/login")]
|
#[route("/login", wasm_split)]
|
||||||
Login {},
|
Login {},
|
||||||
#[route("/register")]
|
#[route("/register", wasm_split)]
|
||||||
Register {},
|
Register {},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user