I'm using VVV for quit some time now and lately I have been evaluating how to develop my WordPress websites.
At the start I used Git and Gulp on my host machine. This worked fine, but when I started using wp-cli and composer I had to switch between host machine and SSH'ing into the virtual machine. This made me question my development strategy.
Inside the VM Git is already available and I added Gulp to the post-provisioning file so that it's also at hand. This works fine, but I found out there is a small delay working inside the VM.
Before I delve any deeper into my development setup I am curious about how other people develop using VVV. What's your strategy? Do you tweak the provisioning a lot?
I tweaked few things
In Vagrantfile I've enabled config.vm.network :public_network, so that I can test my sites on mobile via browsersync.
And I have custom sites set up in my vvv-custom.yml, plus additional browsecap utility that I've written as a provision script.
When developing I use webpack for bundling my files, and I commit plugins and theme to the git with .gitignore looking roughly like this:
# Project Specific
wp-content/themes/theme_name/skin/public
# Wordpress files
wp-admin
wp-includes
/license.txt
/readme.html
/wp-activate.php
/index.php
/wp-blog-header.php
/wp-comments-post.php
/wp-config-sample.php
/wp-config.php
/wp-cron.php
/wp-links-opml.php
/wp-load.php
/wp-login.php
/wp-mail.php
/wp-settings.php
/wp-signup.php
/wp-trackback.php
/xmlrpc.php
.htaccess
robots.txt
# Content
!wp-content/plugins/
# Theme
wp-content/*
!wp-content/mu-plugins/
!wp-content/plugins/
!wp-content/themes/
/wp-content/themes/index.php
# Ignore these plugins from the core
wp-content/plugins/hello.php
wp-content/plugins/akismet/
/wp-content/plugins/index.php
# Ignore specific themes
wp-content/themes/twenty*/
# Project dev files
/vendor
/node_modules/
which resides in the public_html folder alongside the other .*rc files, package.json, wepack.config.js and composer.json among some others.
wp-cli is also available when I'm inside vagrant folders.
So I really rarely need to go to the ssh. Oh and I'm on MacOS.
I only re provision when I need to add a new site.
So far I'm extremely happy with VVV for development.
I'd install gulp/webpack on the host machine, you should only need to ssh in for WP CLI
Also, you should use a Utility to install things like gulp rather than a custom vagrant file
ditto with Tom, I rarely ssh into the virtual machine, except if I need to install a plugin (And even then, I more often do it through the GUI dashboard).
Since site content and most graphics by co-workers, I usually will just use duplicator to import a whole new database (we very so often.
Maybe this isn't smart; but I only work on 1 site, with my theme in version control; no custom plugin development (as of yet); and being the sole developer of the theme (private theme for my employer).
myworkflow is edit the scss file(s) in my theme directory and then have a command (An alias) that runs my grunt file (compiling scss to css; one of these days, i'll add a minifier); and rsync's those changed files to the directory where the /home/vvv/www/wordpress-default/public_html/wp-content/themes/mythemefolder' on my host compute.r
(, as i'm still learning web development and watching tutorials/courses with other themes, once in a great, I'll start the vvv but work on a separate vvv vanilla site/folder);
I would note that you only need a single instance of VVV to work on multiple independent sites. Having multiple copies of VVV gets cumbersome and fiddly, and unnecessary
I'm going to close the issue for now as there's no real way to answer this canonically
Thank you for sharing your insights!
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
I tweaked few things
In
VagrantfileI've enabledconfig.vm.network :public_network, so that I can test my sites on mobile viabrowsersync.And I have custom sites set up in my
vvv-custom.yml, plus additionalbrowsecaputility that I've written as a provision script.When developing I use
webpackfor bundling my files, and I commit plugins and theme to the git with.gitignorelooking roughly like this:which resides in the
public_htmlfolder alongside the other.*rcfiles,package.json,wepack.config.jsandcomposer.jsonamong some others.wp-cliis also available when I'm inside vagrant folders.So I really rarely need to go to the ssh. Oh and I'm on MacOS.
I only re provision when I need to add a new site.
So far I'm extremely happy with VVV for development.