Integrate RSPack Build and SSR via Actix Web + Tera #1
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
riley/rspack-ssr#1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
🛠️ Integrate RSPack Build and SSR via Actix Web + Tera
Labels:
enhancement,ssr,frontend,rspack,actix-web,agent-taskDescription:
Objective
Create an Actix Web server that performs server-side rendering using Tera templates and integrates with the RSPack bundler to compile and serve a React + TypeScript frontend (including JSS and CSS styles).
🧩 Subtasks
Set up RSPack config in Rust
frontend/index.tsxdist/main.js,dist/style.csstsx,ts,jsx,js,css,jssCreate
run_build()functionCreate Tera template at
templates/index.htmlInject:
<link rel="stylesheet" href="/static/style.css"><script src="/static/main.js"></script><div id="root"></div>for React hydrationAccept a
titlevia Tera contextConfigure Actix Web
Render Tera template on
GET /Serve static files from
dist/via/static/Example:
Render response
titleinto Tera contextHttpResponse::Ok().content_type("text/html").body(html)(Optional) Add
--devflag or env to support:📁 Expected Structure
📦 Crate Dependencies
rspackactix-webactix-filesteraserde,serde_json🧠 Success Criteria
/renders a Tera-powered HTML page with correct title/static/