Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions articles/static-web-apps/add-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,15 @@ 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
Copy link
Preview

Copilot AI Sep 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build command npm run dist is incorrect for React with Vite. The standard Vite build command is npm run build, which outputs to the dist folder by default.

Suggested change
npm run dist
npm run build

Copilot uses AI. Check for mistakes.

```

# [Vue](#tab/vue)

Install npm dependencies and build the app into the _dist_ folder.
Expand Down Expand Up @@ -319,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)

Expand Down