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 20, 2023
1 parent 205f25b commit 5a7373d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 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 @@ -36,8 +38,15 @@ let
} ''
mkdir $out
cd $out
cp ${packageLock} ./package-lock.json
cp ${packageJson} ./package.json
${builtins.concatStringsSep "\n"
(builtins.map
(modulePath:
"cp ${modulePath} ./${builtins.baseNameOf (builtins.toString modulePath)} -r")
submodules
)
}
cp ${packageLock} ./package-lock.json -f
cp ${packageJson} ./package.json -f
node2nix ${pkgs.lib.optionalString withDevDeps "--development" } \
--lock ./package-lock.json -i ./package.json
'')
Expand Down

0 comments on commit 5a7373d

Please sign in to comment.