diff --git a/src/builders/nodejs/granular/default.nix b/src/builders/nodejs/granular/default.nix index 8ddbdbfb..27e6639b 100644 --- a/src/builders/nodejs/granular/default.nix +++ b/src/builders/nodejs/granular/default.nix @@ -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 diff --git a/src/translators/nodejs/pure/package-lock/default.nix b/src/translators/nodejs/pure/package-lock/default.nix index 0d9adf15..02ba4030 100644 --- a/src/translators/nodejs/pure/package-lock/default.nix +++ b/src/translators/nodejs/pure/package-lock/default.nix @@ -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"; }; diff --git a/src/translators/nodejs/pure/yarn-lock/default.nix b/src/translators/nodejs/pure/yarn-lock/default.nix index d3c51249..2c023297 100644 --- a/src/translators/nodejs/pure/yarn-lock/default.nix +++ b/src/translators/nodejs/pure/yarn-lock/default.nix @@ -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"; };