From b1e877a96a42422c26545fceb2a8cd06bef985fc Mon Sep 17 00:00:00 2001 From: Venkateswaran Rama Date: Sun, 28 Sep 2025 14:10:54 +0530 Subject: [PATCH] Updated add-api.md to suit React Vite users as well Made changes in 2 places for React Vite users to use dist folder instead of build. While building and while running with swa command locally. --- articles/static-web-apps/add-api.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/articles/static-web-apps/add-api.md b/articles/static-web-apps/add-api.md index 4d32da0f61f39..0af77924cb8e1 100644 --- a/articles/static-web-apps/add-api.md +++ b/articles/static-web-apps/add-api.md @@ -278,6 +278,14 @@ Install npm dependencies and build the app into the _build_ folder. npm install npm run build ``` +# [React (Vite)](#tab/react-vite) + +Install npm dependencies and build the app into the _dist_ folder. + +```bash +npm install +npm run dist +``` # [Vue](#tab/vue) @@ -319,7 +327,14 @@ Run the frontend app and API together by starting the app with the Static Web Ap ```bash swa start build --api-location api ``` + # [React (Vite)](#tab/react-vite) + Pass the build output folder (`dist`) and the API folder (`api`) to the CLI. + + ```bash + swa start dist --api-location api + ``` + # [Vue](#tab/vue) Pass the build output folder (`dist`) and the API folder (`api`) to the CLI.