Skip to content

Commit 342bb4d

Browse files
alan-agius4devchas
authored andcommitted
chore: migrate from npm to pnpm in IDX environment
This commit updates the `.idx/dev.nix` configuration to use `pnpm` instead of `npm` for dependency installation and running the development server. The following changes are included: - Added `pnpm` to the list of Nix packages. - Updated the `onCreate` script to use `pnpm install`. - Updated the `web` preview command to use `pnpm run start`.
1 parent 7e02333 commit 342bb4d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.idx/dev.nix

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
# see: https://developers.google.com/idx/guides/customize-idx-env
33
{ pkgs, ... }: {
44
# Which nixpkgs channel to use.
5-
channel = "stable-24.11"; # or "unstable"
5+
channel = "stable-25.05"; # or "unstable"
66
# Use https://search.nixos.org/packages to find packages
77
packages = [
88
pkgs.nodejs_20
9+
pkgs.pnpm
910
];
1011
# Sets environment variables in the workspace
1112
env = {};
@@ -17,7 +18,7 @@
1718
workspace = {
1819
# Runs when a workspace is first created with this `dev.nix` file
1920
onCreate = {
20-
npm-install = "npm ci --no-audit --prefer-offline --no-progress --timing || npm i --no-audit --no-progress --timing";
21+
npm-install = "pnpm install --frozen-lockfile";
2122
# Open editors for the following files by default, if they exist:
2223
default.openFiles = [ "src/app/app.component.ts" ];
2324
};
@@ -28,7 +29,7 @@
2829
enable = true;
2930
previews = {
3031
web = {
31-
command = ["npm" "run" "start" "--" "--port" "$PORT" "--host" "0.0.0.0"];
32+
command = ["pnpm" "run" "start" "--port" "$PORT" "--host" "0.0.0.0"];
3233
manager = "web";
3334
};
3435
};

0 commit comments

Comments
 (0)