Using Shopware's Watch Scripts
How to use the watch scripts to preview changes without having to recompile everything.
By. Jacob
Edited: 2022-11-06 08:25
1. Go to shopware's root folder:
cd /var/www/shopware/
2. Ron the desired watch- script:
sudo -u www-data bin/watch-storefront.sh
3. Preview your changes on the port number used by the watch script. E.g: http://localhost:8080/
Note. Remember to use the port number the script tells you to, otherwise you will not be able to see any changes. E.g: http://localhost:8080/ instead of http://localhost/.
What are the watch scripts used for?
Shopware has a couple of very useful scripts for developers, which allow us to view our changes "live", without the need to compile everything constantly.
- bin/watch-administration.sh
- bin/watch-storefront.sh
These scripts will start an extra web server on a separate port, so you should pay attention to the port number mentioned in the terminal when running the scripts. watch-administration.sh is used to test changes in the administration back-end while watch-storefront.sh allows you to test things in the storefront.
The scripts also work on your live server, but you need to make sure the port number used is also opened in your firewall.
You may run one of the scripts by typing:
sudo -u www-data bin/watch-administration.sh
Tell us what you think: