Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@sagarp2901
Copy link

Issue 58718 - update the proxying section to state that Vite (with esbuild) is the default dev server, warn about Webpack-specific syntax, and link to the Vite proxy documentation. Adds a clarifying note above the proxy example for new users.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.dev application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: 58718

What is the new behavior?

Documentation update. No new behavior

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Issue 58718 - update the proxying section to state that Vite (with esbuild) is the default dev server, warn about Webpack-specific syntax, and link to the Vite proxy documentation. Adds a clarifying note above the proxy example for new users.
@google-cla
Copy link

google-cla bot commented Sep 21, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@pullapprove pullapprove bot requested a review from mgechev September 21, 2025 19:52
@angular-robot angular-robot bot added the area: docs Related to the documentation label Sep 21, 2025
@ngbot ngbot bot added this to the Backlog milestone Sep 21, 2025
@sagarp2901 sagarp2901 changed the title docs: clarify Vite proxy configuration and update serve.md instructions issue #58718 docs: clarify Vite proxy configuration and update serve.md instructions Sep 21, 2025
@alan-agius4 alan-agius4 added adev: preview action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Sep 24, 2025
@github-actions
Copy link

github-actions bot commented Sep 24, 2025

Deployed adev-preview for a479a28 to: https://ng-dev-previews-fw--pr-angular-angular-63975-adev-prev-gdxyk1s4.web.app

Note: As new commits are pushed to this pull request, this link is updated after the preview is rebuilt.

@sagarp2901
Copy link
Author

Hi @alan-agius4, any thoughts/suggestions on this PR?

@alan-agius4
Copy link
Contributor

Thanks for your contribution. But there is already a PR open for this: #63588

@sagarp2901
Copy link
Author

@alan-agius4, not sure if this PR is being actively contributed to #63588 but I can help close the issue if you with my PR here.

@JeanMeche JeanMeche reopened this Oct 10, 2025
Copy link
Contributor

@alan-agius4 alan-agius4 left a comment

Choose a reason for hiding this comment

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

Thanks for this. Please see comment.


1. Add the following content to the new proxy file:

> **Note:** This example works for Vite (the default dev server) and most simple proxy scenarios. For advanced options or path matching, refer to the [Vite proxy documentation](https://vitejs.dev/config/server-options.html#server-proxy).
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's avoid adding so many notes. One should suffice IMHO.

Suggested change
> **Note:** This example works for Vite (the default dev server) and most simple proxy scenarios. For advanced options or path matching, refer to the [Vite proxy documentation](https://vitejs.dev/config/server-options.html#server-proxy).


Use [proxying support](https://webpack.js.org/configuration/dev-server/#devserverproxy) to divert certain URLs to a backend server, by passing a file to the `--proxy-config` build option.
For example, to divert all calls for `http://localhost:4200/api` to a server running on `http://localhost:3000/api`, take the following steps.
> **Note:** As of Angular v18, the default development server is powered by [Vite](https://vitejs.dev/) (with esbuild), not Webpack. Proxy configuration should follow Vite's proxy options. Webpack-specific proxy syntax (such as a bare `*` for path matching) will **not** work with Vite. See the [Vite proxy documentation](https://vitejs.dev/config/server-options.html#server-proxy) for all available options and syntax.
Copy link
Contributor

Choose a reason for hiding this comment

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

This document is for version 20 and v21 and thus let's focus it's content on the default. (Vite). Since custom builders are not supported, they shouldn't be included in the official documentation. Also, let's reduce the number of notes throughout this section.

So I'd suggest to revert this part and just update the links.

Comment on lines +85 to 89
For a detailed description of all options, refer to the [Vite DevServer documentation](https://vitejs.dev/config/server-options.html#server-proxy) (default for new projects), or the [Webpack DevServer documentation](https://webpack.js.org/configuration/dev-server/#devserverproxy) if you are using the legacy Webpack builder.

**Warning:** Proxy configuration syntax differs between Vite and Webpack. For example, Vite does not support a bare `*` as a path matcher. Always consult the correct documentation for your builder.

NOTE: If you edit the proxy configuration file, you must relaunch the `ng serve` process to make your changes effective.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
For a detailed description of all options, refer to the [Vite DevServer documentation](https://vitejs.dev/config/server-options.html#server-proxy) (default for new projects), or the [Webpack DevServer documentation](https://webpack.js.org/configuration/dev-server/#devserverproxy) if you are using the legacy Webpack builder.
**Warning:** Proxy configuration syntax differs between Vite and Webpack. For example, Vite does not support a bare `*` as a path matcher. Always consult the correct documentation for your builder.
NOTE: If you edit the proxy configuration file, you must relaunch the `ng serve` process to make your changes effective.
NOTE:
* To apply changes made to your **proxy configuration file**, you must **restart the `ng serve` process**.
* The specific configuration details depend on the project's builder:
* For the **`@angular-devkit/build-angular:browser`** builder, see the [Webpack DevServer documentation](https://webpack.js.org/configuration/dev-server/#devserverproxy).
* For the **`@angular/build:application`** builder, see the [Vite DevServer documentation](https://vite.dev/config/server-options#server-proxy).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer adev: preview area: docs Related to the documentation target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants