From 35ffcbc62b53adffbb1a0c9ee302856f3c7bfe01 Mon Sep 17 00:00:00 2001 From: amitfin Date: Fri, 9 Oct 2020 20:34:30 +0300 Subject: [PATCH] Update development.md (#672) * Update development.md Visual Studio Code with devcontainers is the recommended dev environment for Home Assistant. However, it's not trivial to integrate this dev environment with the frontend dev environment, as the Home Assistant's container doesn't have access to the frontend directory. Adding the instructions on how to mount the frontend directory to the container. * Update development.md * Update development.md --- docs/frontend/development.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/frontend/development.md b/docs/frontend/development.md index 38aa9994..bd3666b9 100644 --- a/docs/frontend/development.md +++ b/docs/frontend/development.md @@ -33,6 +33,23 @@ frontend: development_repo: /path/to/hass/frontend/ ``` +If you are using Visual Studio Code with devcontainers for Home Assistant, you need to mount the `frontend` directory into the container. Add the following section to `.devcontainer/devcontainer.json`: + +```json +"mounts": [ + "source=/path/to/hass/frontend,target=/workspaces/frontend,type=bind,consistency=cached" +] +``` + +The Home Assistant's devcontainer needs to get rebuit via the `docker-build` [task](/development_environment.md#tasks), and the `configuration.yaml` should point to the path inside the container: + +```yaml +frontend: + development_repo: /workspaces/frontend/ +``` + +The change to `.devcontainer/devcontainer.json` should be excluded from any PR as it contains your local path to the `frontend` repository. + ### Installing Node.js Node.js is required to build the frontend. The preferred method of installing node.js is with [nvm](https://github.com/creationix/nvm). Install nvm using the instructions in the [README](https://github.com/creationix/nvm#install-script), and install the correct node.js by running the following command: