Skip to content

Commit

Permalink
fix: use upstream's pruned nodeModules
Browse files Browse the repository at this point in the history
  • Loading branch information
tgunnoe committed Jul 11, 2024
1 parent e847900 commit 4de4695
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
7 changes: 0 additions & 7 deletions nix/lib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,9 @@
ln -s ${project.nodeModules}/lib/node_modules $out/node_modules
'';
});
prunedNodeModules = project.nodeModules.overrideAttrs (old: {
fixupPhase = ''
echo "Pruning node modules for production..."
cd $out/lib && npm prune --omit=dev
'';
});
in
project
// {
compiled = compiled';
nodeModules = prunedNodeModules;
};
}
3 changes: 2 additions & 1 deletion nix/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,14 @@ in rec {
node "$CLI_TMP" "$@"
'';
prunedNodeModules = project.mkNodeModules {withDevDeps = false;};
in
pkgs.runCommand "bundled-cli"
{
buildInputs = [pkgs.zip];
}
''
cp -R ${project.nodeModules}/lib/node_modules .
cp -R ${prunedNodeModules}/lib/node_modules .
chmod -R u+rw ./node_modules
cp ${wrappedNodeScript} ./sidechain-cli
mkdir -p $out
Expand Down

0 comments on commit 4de4695

Please sign in to comment.