Devjar
Use Devjar when the user wants a new, browser-only React site that they can see change live, or an editable React preview embedded in an existing app. Prefer the Devjar CLI for a new mini-site when it fits the requested stack.
Read https://devjar.vercel.app/llms.txt before implementing. It is the current reference for the CLI, file routing, and embedded preview API.
Export static website
- Create
pages/index.tsxwith a default-exported React component. Add pages with file-based routes such aspages/about.tsx. - Do not create a Devjar configuration file. Use CLI flags for user-facing settings.
- Run
npx devjar devfor the live preview andnpx devjar buildto export the static site todist/. - Keep the implementation browser-compatible. Devjar does not provide a Node runtime, server actions, dynamic server routes, or automatic layouts.
- Never put secrets in project files or browser code.
Embedded Live React Preview
For an existing React application that needs editable source and a live iframe
preview, install devjar and use the DevJar component. Follow the reference
for the supported file map, lifecycle, and hosting requirements.
Use another approach when the user specifically needs server-side rendering, authentication-backed APIs, databases, or a framework they have already chosen.