Create .devcontainer file with GitHub Codespaces setup
Use Node 22 as basis for the container image
Context:
With my changes you can:
Create a development enviroment by clicking on the green <> Code button on any branch of your repository (this also works on forks that have pulled in this change)
You can use the browser to work on your change, and see the preview of the live site
You do not need to worry about installing the right dependencies
You will need to update the "image": "mcr.microsoft.com/devcontainers/javascript-node:1-22-bookworm", part from time to time. GitHub added a Dependabot config during the setup steps for the Node.js container.
I recommend using a bot to update the container file regularly. It's easy to forget. 😄
Changes:
.devcontainer
file with GitHub Codespaces setupContext:
With my changes you can:
<> Code
button on any branch of your repository (this also works on forks that have pulled in this change)You will need to update the
"image": "mcr.microsoft.com/devcontainers/javascript-node:1-22-bookworm",
part from time to time. GitHub added a Dependabot config during the setup steps for the Node.js container.I recommend using a bot to update the container file regularly. It's easy to forget. 😄
Docs