Skip to content

Commit f971cdf

Browse files
committed
add v:serve shortcut for vagrant
automatically install nodejs and yarn add some info on change detection in vagrant to BUILDING.md
1 parent 5e3f705 commit f971cdf

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

.dev/vagrant/provision.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ debconf-set-selections <<< 'mariadb-server-5.5 mysql-server/root_password_again
2121
# actually install
2222
apt-get install -y php7.2 php7.2-cli php7.2-gd php7.2-mysql php7.2-pdo php7.2-mbstring php7.2-tokenizer php7.2-bcmath php7.2-xml php7.2-fpm php7.2-memcached php7.2-curl php7.2-zip php-xdebug mariadb-server nginx curl tar unzip git memcached > /dev/null
2323

24+
echo "Install nodejs and yarn"
25+
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
26+
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
27+
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
28+
apt-get -y install nodejs yarn > /dev/null
29+
2430
echo "Install composer"
2531
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
2632

BUILDING.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ is the `--host` flag, which is required and should point to the machine where th
3737
The second is the `PUBLIC_PATH` environment variable which is the URL pointing to the HMR server and is appended to all of
3838
the asset URLs used in Pterodactyl.
3939

40+
#### Vagrant
41+
If you want to use HMR with our Vagrant image, you can use `yarn run v:serve` as a shortcut for the correct parameters.
42+
In order to have proper file change detection you can use the [`vagrant-notify-forwarder`](https://github.com/mhallin/vagrant-notify-forwarder) to notify file events from the host to the VM.
43+
```sh
44+
vagrant plugin install vagrant-notify-forwarder
45+
vagrant reload
46+
```
47+
4048
### Building for Production
4149
Once you have your files squared away and ready for the live server, you'll be needing to generate compiled, minified, and
4250
hashed assets to push live. To do so, run the command below:

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"watch": "NODE_ENV=development ./node_modules/.bin/webpack --watch --progress",
5858
"build": "NODE_ENV=development ./node_modules/.bin/webpack --progress",
5959
"build:production": "NODE_ENV=production ./node_modules/.bin/webpack",
60-
"serve": "NODE_ENV=development webpack-serve --hot --config ./webpack.config.js"
60+
"serve": "webpack-serve --hot --config ./webpack.config.js",
61+
"v:serve": "PUBLIC_PATH=http://192.168.50.2:8080 NODE_ENV=development webpack-serve --hot --config ./webpack.config.js --host 192.168.50.2 --no-clipboard"
6162
}
6263
}

0 commit comments

Comments
 (0)