loco-rs / loco

🚂 🦀 The one-person framework for Rust for side-projects and startups
https://loco.rs
Apache License 2.0
4.04k stars 169 forks source link

When using react, run `npm/yarn/pnpm build` while building the app #786

Open assapir opened 3 days ago

assapir commented 3 days ago

Description

If one tries to start their app which bundled with react frontend without building it first, they will an error stating Error: Message("one of the static path are not found, Folderfrontend/distfallback:frontend/dist/index.html")

To Reproduce

Create a SaaS app with React frontend. run cargo loco run

Expected Behavior

Suggest to have a build.rs that will run the build for the fronted. Even better will be that if it's in dev mode, it will start the react app in dev mode