Server Options
Options for the development server (orgp dev). Configuration is passed through the vite.server option.
Basic Configuration
// .org-press/config.ts
export default {
vite: {
server: {
port: 3000,
host: true, // Expose to network
open: true, // Open browser on start
},
},
};
port
- Type:
number - Default:
5173
Development server port. If the port is in use, Vite will try the next available port.
vite: {
server: {
port: 3000,
strictPort: true, // Fail if port in use
}
}
host
- Type:
string | boolean - Default:
"localhost"
Specify which IP addresses the server should listen on.
vite: {
server: {
host: true, // Listen on all addresses (0.0.0.0)
host: "0.0.0.0", // Same as above
host: "192.168.1.5" // Specific IP
}
}
Set host: true to access the dev server from other devices on the network.
open
- Type:
boolean | string - Default:
false
Automatically open the browser when the server starts.
vite: {
server: {
open: true, // Open default browser
open: "/guide/", // Open specific path
open: "firefox", // Open specific browser
}
}
https
- Type:
boolean | https.ServerOptions - Default:
false
Enable HTTPS for the dev server.
import fs from "node:fs";
export default {
vite: {
server: {
https: {
key: fs.readFileSync("localhost-key.pem"),
cert: fs.readFileSync("localhost.pem"),
}
}
}
};
For quick local HTTPS, use mkcert to generate certificates.
proxy
- Type:
Record<string, ProxyOptions>
Proxy API requests during development. Useful when your frontend and backend are on different ports.
vite: {
server: {
proxy: {
// String shorthand
"/api": "http://localhost:8080",
// With options
"/api": {
target: "http://localhost:8080",
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ""),
},
}
}
}
watch
- Type:
object
File system watcher options passed to chokidar.
vite: {
server: {
watch: {
// Ignore large directories
ignored: ["**/node_modules/**", "**/dist/**"],
}
}
}
HMR (Hot Module Replacement)
Org-press supports HMR out of the box. Edit your org files and see changes instantly.
To customize HMR behavior:
vite: {
server: {
hmr: {
overlay: false, // Disable error overlay
}
}
}
See Also
- Build Options - Production build configuration
- Shared Options -
contentDir,outDir,base - Vite Server Options - Full Vite server documentation