Skip to content

Support configuring the printed URLs #19938

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
4 tasks done
frantic1048 opened this issue Apr 25, 2025 · 0 comments
Open
4 tasks done

Support configuring the printed URLs #19938

frantic1048 opened this issue Apr 25, 2025 · 0 comments

Comments

@frantic1048
Copy link

Description

This issue follows #10994. We have a slightly different use case but also require the ability to configure the URLs displayed in logs.

We are running the Vite development server behind a locally running reverse proxy. To access the development server, we use the following setup:

https://example.development.domain.com (reverse proxy) → localhost:5173 (Vite dev server)

Since Vite does not know which domain will be used to access the development server, we need a way to explicitly provide this information to Vite.

To specify which URL to open when Vite starts, we can currently use the server.open option.

However, there is currently no way to control which URL is displayed in Vite's logs. This is the functionality we are missing.

Suggested solution

The solution suggested in #10994 is enough for this use case.

vite.config.ts

import { defineConfig } from 'vite'

export default defineConfig({
  // ...
  server: {
    // these URLs will be printed as "key: value", line by line
    printedUrls: {
      // override vite resolved URL for local
      local: 'https://example.development.domain.com',
      // explicitly hide vite resolved URL for network
      network: false,
      // perhaps we can allow specifying more URLs ?
      "another-network": 'https://url.for.another.network.com'
    }
  }
})

Alternative

No response

Additional context

No response

Validations

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

No branches or pull requests

1 participant