Skip to content

Commit

Permalink
Support npm submodules
Browse files Browse the repository at this point in the history
  • Loading branch information
SeungheonOh committed Mar 23, 2023
1 parent 205f25b commit c41bbe4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
, spagoPackages ? "${src}/spago-packages.nix"
# Configuration that will be used to generate a `devShell` for the project
, shell ? { }
# Path to submodule locations that needs to be copied when making node env
, submodules ? [ ]
, ...
}:
let
Expand All @@ -38,6 +40,13 @@ let
cd $out
cp ${packageLock} ./package-lock.json
cp ${packageJson} ./package.json
cp ${
pkgs.linkFarm "node-packages-${projectName}-source"
(builtins.map (path: {
inherit path;
name = builtins.baseNameOf (builtins.toString path);
}) submodules)
}/* . -r
node2nix ${pkgs.lib.optionalString withDevDeps "--development" } \
--lock ./package-lock.json -i ./package.json
'')
Expand Down

0 comments on commit c41bbe4

Please sign in to comment.