summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdriaan van der Bergh2024-05-20 19:18:42 +0200
committerGitHub2024-05-20 19:18:42 +0200
commitfd78152fc9e2cdf5af622dd66af68278ef5a5727 (patch)
tree920a1136466065e7fad8401c442a353bb69be39a
parent8a54a4369715f03194382e506ef5d558836a307e (diff)
downloadIT.starlight-fd78152fc9e2cdf5af622dd66af68278ef5a5727.tar.gz
IT.starlight-fd78152fc9e2cdf5af622dd66af68278ef5a5727.tar.bz2
IT.starlight-fd78152fc9e2cdf5af622dd66af68278ef5a5727.zip
Fix `.pnpm-store` in devcontainer setup (#1881)
Co-authored-by: HiDeoo <494699+HiDeoo@users.noreply.github.com>
-rw-r--r--.devcontainer/Dockerfile5
-rw-r--r--.devcontainer/devcontainer.json2
2 files changed, 4 insertions, 3 deletions
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
index f3d56a54..207f5d81 100644
--- a/.devcontainer/Dockerfile
+++ b/.devcontainer/Dockerfile
@@ -1,7 +1,8 @@
# Based on https://github.com/withastro/astro/blob/main/.devcontainer/Dockerfile
FROM mcr.microsoft.com/devcontainers/javascript-node:0-18
-# Install latest pnpm
-RUN npm install -g pnpm
+# We uninstall pnpm here, since we enable the corepack version in the postCreateCommand
+# This ensures we respect the "packageManager" version in package.json
+RUN npm uninstall -g pnpm
COPY welcome-message.txt /usr/local/etc/vscode-dev-containers/first-run-notice.txt \ No newline at end of file
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index 2b192ec9..47798932 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -3,7 +3,7 @@
"build": {
"dockerfile": "Dockerfile"
},
- "postCreateCommand": "pnpm install",
+ "postCreateCommand": "sudo corepack enable pnpm && pnpm config set store-dir /home/node/.pnpm-store && PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 pnpm install",
"waitFor": "postCreateCommand",
"customizations": {
"codespaces": {