From 1e3ceb530751ed28de1551f55682751a3113f0f2 Mon Sep 17 00:00:00 2001 From: winston Date: Sun, 10 Mar 2024 13:07:59 +0100 Subject: [PATCH] build: use node-modules nodeLinker for storybook --- .yarnrc.yml | 2 +- nix/yarn-project.nix | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.yarnrc.yml b/.yarnrc.yml index 4f62a528..67f38aae 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -4,7 +4,7 @@ generateDefaultNix: false nixExprPath: nix/yarn-project.nix -nodeLinker: pnpm +nodeLinker: node-modules packageExtensions: "@storybook/builder-vite@*": diff --git a/nix/yarn-project.nix b/nix/yarn-project.nix index b169a895..c6917eec 100644 --- a/nix/yarn-project.nix +++ b/nix/yarn-project.nix @@ -121,6 +121,7 @@ let cp --reflink=auto --recursive .yarn "$out/libexec/$name" # Copy the Yarn linker output into the package. + cp --reflink=auto --recursive node_modules "$out/libexec/$name" fi cd "$out/libexec/$name" @@ -129,6 +130,9 @@ let mkdir -p "$out/bin" yarn nixify install-bin $out/bin + # A package with node_modules doesn't need the cache + yarn cache clean + runHook postInstall '';