Skip to content
Snippets Groups Projects

devcontainer-vite-react

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Noriki I

    Dev container setup for Vite + React.

    Edited
    devcontainer.json 749 B
    {
        // Run 'npm create vite@latest my-app -- --template react' to create a new React app
        "name": "React Vite DevContainer",
        "image": "mcr.microsoft.com/devcontainers/javascript-node:20",
        "features": {
            "ghcr.io/devcontainers/features/node:1": {
                "version": "20"
            }
        },
        "customizations": {
            "vscode": {
                "settings": {},
                "extensions": [
                    "dbaeumer.vscode-eslint",
                    "esbenp.prettier-vscode"
                ]
            }
        },
        "postCreateCommand": "sudo chown node node_modules",
        "mounts": [
            "source=${localWorkspaceFolderBasename}-node_modules,target=${containerWorkspaceFolder}/node_modules,type=volume"
        ]
    }
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment