nodejs: enable dev deps by default

This commit is contained in:
DavHau 2021-11-01 11:46:38 +07:00
parent 6850db9cc4
commit 2fd7782af4
3 changed files with 10 additions and 6 deletions

View File

@ -227,6 +227,7 @@ let
# - adds executables of direct node dependencies to PATH
# - adds the current node module to NODE_PATH
# - sets HOME=$TMPDIR, as this is required by some npm scripts
# TODO: don't install dev dependencies. Load into NODE_PATH instead
d2nInstallDependenciesPhase = ''
# symlink dependency packages into node_modules
for dep in $(cat $nodeDepsPath); do

View File

@ -14,7 +14,7 @@
inputDirectories,
inputFiles,
dev,
noDev,
nodejs,
...
}@args:
@ -22,6 +22,8 @@
b = builtins;
dev = ! noDev;
packageLock =
if inputDirectories != [] then
"${lib.elemAt inputDirectories 0}/package-lock.json"
@ -141,8 +143,8 @@
extraArgs = {
dev = {
description = "include dependencies for development";
noDev = {
description = "Whether to exclude development dependencies";
type = "flag";
};

View File

@ -15,7 +15,7 @@
# extraArgs
name,
dev,
noDev,
optional,
peer,
...
@ -23,6 +23,7 @@
let
b = builtins;
dev = ! noDev;
yarnLock = utils.readTextFile "${lib.elemAt inputDirectories 0}/yarn.lock";
packageJSON = b.fromJSON (b.readFile "${lib.elemAt inputDirectories 0}/package.json");
parser = import ../yarn-lock/parser.nix { inherit lib; inherit (externals) nix-parsec;};
@ -225,8 +226,8 @@
type = "argument";
};
dev = {
description = "Whether to include development dependencies";
noDev = {
description = "Whether to exclude development dependencies";
type = "flag";
};