vite-plugin-named-port
v2.0.0
Published
Use a deterministic port for your Vite dev server
Readme
vite-plugin-named-port
Use a deterministic port for your Vite dev server.
Based on named-port package.
Usage
// vite.config.js
import namedPort from 'vite-plugin-named-port';
export default {
// default: uses package.json name or current directory, with port range 1024-65535
plugins: [namedPort()],
// with custom string input
plugins: [namedPort({ input: 'custom-text' })],
// with custom port range
plugins: [namedPort({ min: 3000, max: 4000 })],
};If you don't provide a custom input, the plugin will try to read the name field from your package.json file. If it's not present, it will use the current working directory name instead.
By default, if min and max are not specified, the port will be chosen in the range 1024–65535.
License
MIT
