From e1340c0aebea490714791557f5e8b4c3019c3d80 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Fri, 17 Apr 2026 18:50:42 +0300 Subject: [PATCH] prettier-plugin-svelte: skip npm prune step; remove redundant build deps Signed-off-by: NotAShelf Change-Id: I296b2b0b59f6eaec0563c97c011d4a356a6a6964 --- .../pkgs/by-name/prettier-plugin-svelte/package.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/flake/pkgs/by-name/prettier-plugin-svelte/package.nix b/flake/pkgs/by-name/prettier-plugin-svelte/package.nix index 69cce6df..7ff82feb 100644 --- a/flake/pkgs/by-name/prettier-plugin-svelte/package.nix +++ b/flake/pkgs/by-name/prettier-plugin-svelte/package.nix @@ -17,11 +17,12 @@ in npmDepsHash = "sha256-XVyLW0XDCvZCZxu8g1fP7fRfeU3Hz81o5FCi/i4BKQw="; - # FIXME: this probably also copies over build dependencies. - # Look at how other prettier plugins in nixpkgs do things. I couldn't get it to work - # and am out of time so good luck :) - preInstall = '' - mkdir -p $out/lib - cp -r node_modules $out + dontNpmPrune = true; + + # Fixes error: Cannot find module 'prettier' + postInstall = '' + pushd "$nodeModulesPath" + find -mindepth 1 -maxdepth 1 -type d -print0 | grep --null-data -Exv "\./(ulid|prettier)" | xargs -0 rm -rfv + popd ''; })