> modern-dev-workflow
Guide for using the Vite-powered modern dev server and managing local development configuration in WP Rig.
curl "https://skillshub.wtf/wprig/wprig/modern-dev-workflow?format=md"Modern Dev Workflow in WP Rig
WP Rig offers a high-performance development experience via its "modern" dev server, powered by esbuild, browsersync, and Bun. This provides lightning-fast HMR (Hot Module Replacement) and optimized asset serving.
Dev Server Commands
Modern (Recommended)
npm run dev:modern
This launches an esbuild proxy server that handles CSS, JS, and PHP updates with minimal latency.
Legacy (BrowserSync)
npm run dev
Use this if the modern server is not compatible with your environment or specific requirements.
Configuration & Local Access
Before configuring or starting the development environment, you MUST reference the config/config.json.
- Proxy URL: Use
dev.browserSync.proxyURL(ordev.devURLfor modern) for local URL references. - Admin Access: Use
dev.admincredentials if automated testing or environment setup requires administrative access.
Configuration (config/config.json)
All dev server settings are managed in config/config.json. Ensure your local URL is correctly set.
Example Configuration
{
"dev": {
"devURL": "http://wprig-dev.local",
"port": 3000,
"modern": {
"port": 5173,
"https": false,
"open": true
}
}
}
Key Configuration Properties
devURL: The local URL of your WordPress installation. This is the source for the proxy server.port: The port for the legacy BrowserSync server.modern.port: The port for the Vite dev server.modern.https: Set totrueif your local WordPress site uses HTTPS.modern.open: Automatically open the browser on startup.
SSL & HTTPS
If your local site is running over HTTPS, you must configure the modern dev server to support it.
- Ensure
modern.httpsistrueinconfig/config.json. - WP Rig automatically attempts to generate or use existing SSL certificates (typically via
mkcert). - If certificates are not found, the server may fall back to HTTP or prompt for manual setup.
Troubleshooting
- Proxy Failures: Ensure
devURLmatches your local site exactly (includinghttp://orhttps://). - Port Conflicts: If port
5173or3000is already in use, update the ports inconfig/config.json. - HMR Not Working: Verify that your browser is not blocking connections to the Vite port.
Best Practices for Agents
- Always use Modern: Prefer
npm run dev:modernfor faster development. - Local Environment Detection: Before running dev scripts, check the current
devURLinconfig/config.jsonto ensure it matches the environment. - Configuration Persistence: Always make changes to
config/config.json, not the defaultconfig/config.default.json. - Environment Check: If you encounter issues, verify that the local WordPress site is up and reachable before starting the dev server.
> related_skills --same-repo
> wp-cli
Guide for using WP Rig custom WP-CLI commands to manage development environments.
> web-designer
Creatively conjure aesthetically pleasing, satisfyingly interactive, performant, and accessible style guides for theme components.
> theme-settings
Guide for adding and managing theme settings using the React-based Options framework in WP Rig.
> theme-bundling
Guide to ensuring new root-level folders (like WooCommerce template overrides) are included in the bundled theme.