diff --git a/Makefile b/Makefile index c138ad5..9529d9e 100644 --- a/Makefile +++ b/Makefile @@ -4,14 +4,14 @@ # tools. (i.e. podman) CONTAINER_TOOL ?= docker -# Docker image name for the mkdocs based local development setup +# Docker image name for the VitePress based local development setup IMAGE=ironcore-dev/ironcore-dev.github.io .PHONY: startdocs -startdocs: ## Start the local mkdocs based development environment. - docker build -t $(IMAGE) -f docs/Dockerfile . --load - docker run --rm -p 5173:5173 -v `pwd`/:/app $(IMAGE) +startdocs: ## Start the local VitePress based development environment. + $(CONTAINER_TOOL) build -t $(IMAGE) -f docs/Dockerfile . --load + $(CONTAINER_TOOL) run --rm -p 5173:5173 -v `pwd`/:/app -v /app/node_modules $(IMAGE) .PHONY: cleandocs -cleandocs: ## Remove all local mkdocs Docker images (cleanup). - docker container prune --force --filter "label=project=ironcore_docs" +cleandocs: ## Remove all local VitePress Docker images (cleanup). + $(CONTAINER_TOOL) image prune --all --force --filter "label=project=ironcore_docs" diff --git a/hack/start-docs.sh b/hack/start-docs.sh index 4899de4..a1dfec2 100755 --- a/hack/start-docs.sh +++ b/hack/start-docs.sh @@ -3,6 +3,14 @@ # Install dependencies npm ci +# Enable file polling: inotify events from macOS host edits do not reach the container through +# Docker Desktop's bind mount, so live-reload only works with chokidar's polling watcher. +# +# Note on Linux polling is not required and these exports could be guarded to macOS. However, for +# simplicity, keeping it uniform. +export CHOKIDAR_USEPOLLING=true +export CHOKIDAR_INTERVAL=2000 + # Run VitePress dev server npx vitepress dev docs --host 0.0.0.0 &