From ee286ab75f48c1faefc7a6f0223d5cfd2e44f3c1 Mon Sep 17 00:00:00 2001 From: tyler36 <7234392+tyler36@users.noreply.github.com> Date: Tue, 3 Dec 2024 13:24:58 +0900 Subject: [PATCH] docs: add "auto-start" section --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 9f6c600..83af672 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ - [Introduction](#introduction) - [Getting Started](#getting-started) + - [Auto-start the watcher server](#auto-start-the-watcher-server) - [What does this add-on do?](#what-does-this-add-on-do) - [Integrations](#integrations) - [Laravel Mix Configuration](#laravel-mix-configuration) @@ -58,6 +59,25 @@ ddev launch :3000 The site should briefly display "Browsersync: connect" in the top right corner, confirming it is connect to the server. +### Auto-start the watcher server + +You can use DDEV's `post-start` hook to start the watcher server and launch the page when DDEV starts. + +1. Create a `.ddev/config.browsersync-extras.yaml` + +```yml +hooks: + post-start: + - exec-host: bash -c "ddev browsersync &" + - exec-host: ddev launch :3000 +``` + +1. Restart DDEV to apply the changes. + +```shell +ddev restart +``` + ## What does this add-on do? 1. Checks to make sure the DDEV version is adequate.