From 5caaab03461ea44338ffe085d3137ab824aa289b Mon Sep 17 00:00:00 2001 From: Venkateswaran Rama Date: Sun, 28 Sep 2025 13:37:58 +0530 Subject: [PATCH 1/2] Update add-api.md build steps for React[Vite] added to point to dist folder --- articles/static-web-apps/add-api.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/articles/static-web-apps/add-api.md b/articles/static-web-apps/add-api.md index 4d32da0f61f39..83752960aa232 100644 --- a/articles/static-web-apps/add-api.md +++ b/articles/static-web-apps/add-api.md @@ -279,6 +279,15 @@ npm install npm run build ``` +# [React](#tab/Vite) + +Install npm dependencies and build the app into the _build_ folder. + +```bash +npm install +npm run dist +``` + # [Vue](#tab/vue) Install npm dependencies and build the app into the _dist_ folder. From b87a56e720dd8a80c534cc7555bec09a3ff82fea Mon Sep 17 00:00:00 2001 From: Venkateswaran Rama Date: Sun, 28 Sep 2025 14:01:38 +0530 Subject: [PATCH 2/2] Update add-api.md Missed to address the Vite related changes in other places --- articles/static-web-apps/add-api.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/articles/static-web-apps/add-api.md b/articles/static-web-apps/add-api.md index 83752960aa232..3c2e51f2ccc7c 100644 --- a/articles/static-web-apps/add-api.md +++ b/articles/static-web-apps/add-api.md @@ -279,9 +279,9 @@ npm install npm run build ``` -# [React](#tab/Vite) +# [React (Vite)](#tab/react-vite) -Install npm dependencies and build the app into the _build_ folder. +Install npm dependencies and build the app into the _dist_ folder. ```bash npm install @@ -328,6 +328,13 @@ 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)