From 817452cea888c2957c075b39371f297feb40ac5c Mon Sep 17 00:00:00 2001 From: Taylor Brown Date: Sun, 29 Aug 2021 20:34:57 +0000 Subject: [PATCH] Run `npm ci` automatically after the devcontainer is created. This reduces the chance that another dev will forget to do this. --- .devcontainer/devcontainer.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f40ff7e8..e590542e 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -18,7 +18,9 @@ // Use 'forwardPorts' to make a list of ports inside the container available locally. // "forwardPorts": [], // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "yarn install", + // We use `npm ci` instead of `npm install` because we want to respect the lockfile and ONLY the lockfile. + // That way, our devcontainer is more reproducible. --Taytay + "postCreateCommand": "npm ci", // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. "remoteUser": "node" } \ No newline at end of file