How to hide localhost URLs when launching? #19395
-
Hi all, When I run Vite, is there a way to tell it to not suggest any local URLs, or accept that the custom domain I have entered is the local one?
The problem is that our single-signon environment will only accept I've looked through the docs and only What am I missing? How can I get Vite to only show URLs I have specified and no others? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Vite seems not to open any option to change this, instead, write a plugin to do it. Here's an example: // serverPlugin.ts
export default () => ({
name: 'server',
/**
* @param {import("vite").ViteDevServer} server
*/
configureServer(server) {
return () => {
console.log('server: ', server);
server.printUrls = () => {};
};
}
}); import { defineConfig } from "vite"
import serverPlugin from "./serverPlugin"
export default defineConfig({
plugins: [ serverPlugin() ]
}) |
Beta Was this translation helpful? Give feedback.
-
Hi, you can also, simply add to your server/preview config this: open: 'myorg-development.local' or a full custom like : |
Beta Was this translation helpful? Give feedback.
Vite seems not to open any option to change this, instead, write a plugin to do it. Here's an example: