Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node_modules folder inside host, not symlinked #33

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
6 changes: 4 additions & 2 deletions provision/vvv-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ function try_npm_install() {
nvm use
fi
echo " * Running npm install after svn up/git pull"
noroot mkdir -p /home/vagrant/.vvv/"${SITE_TITLE}"/wp_develop_node_modules
noroot mkdir -p ./node_modules
mount --bind /home/vagrant/.vvv/"${SITE_TITLE}"/wp_develop_node_modules ./node_modules
# Grunt can crash because doesn't find a folder, the workaround is remove the node_modules folder and download all the dependencies again.
npm_config_loglevel=error npm install --no-optional
echo " * Checking npm install result"
Expand Down Expand Up @@ -188,7 +191,6 @@ fi

if [[ "${NPM}" == "true" ]]; then
try_npm_install
try_npm_build
else
echo ' * NPM package installation ignored'
fi
Expand All @@ -205,7 +207,7 @@ if [[ "${NPM}" == "true" ]]; then
if [[ ! -d "${VVV_PATH_TO_SITE}/public_html/build" ]]; then
echo " * Initializing grunt... This may take a few moments."
cd "${VVV_PATH_TO_SITE}/public_html/"
try_grunt_build
try_npm_build
echo " * Grunt initialized."
fi
fi
Expand Down