yarnBuildHook: init
This commit is contained in:
parent
a84f3ca3d8
commit
296556a320
@ -168,4 +168,11 @@ in
|
||||
description = "Install nodejs dependencies from an offline yarn cache produced by fetchYarnDeps";
|
||||
};
|
||||
} ./yarn-config-hook.sh;
|
||||
|
||||
yarnBuildHook = makeSetupHook {
|
||||
name = "yarn-build-hook";
|
||||
meta = {
|
||||
description = "Run yarn build in buildPhase";
|
||||
};
|
||||
} ./yarn-build-hook.sh;
|
||||
}
|
||||
|
25
pkgs/build-support/node/fetch-yarn-deps/yarn-build-hook.sh
Normal file
25
pkgs/build-support/node/fetch-yarn-deps/yarn-build-hook.sh
Normal file
@ -0,0 +1,25 @@
|
||||
yarnBuildHook() {
|
||||
runHook preBuild
|
||||
echo "Executing yarnBuildHook"
|
||||
|
||||
if [ -z "${yarnBuildScript-}" ]; then
|
||||
yarnBuildScript="build"
|
||||
fi
|
||||
|
||||
if ! type node > /dev/null 2>&1 ; then
|
||||
echo yarnConfigHook WARNING: a node interpreter was not added to the \
|
||||
build, and is probably required to run \'yarn $yarnBuildHook\'. \
|
||||
A common symptom of this is getting \'command not found\' errors \
|
||||
for Nodejs related tools.
|
||||
fi
|
||||
|
||||
yarn --offline "$yarnBuildScript" \
|
||||
$yarnBuildFlags "${yarnBuildFlagsArray[@]}"
|
||||
|
||||
echo "finished yarnBuildHook"
|
||||
runHook postBuild
|
||||
}
|
||||
|
||||
if [[ -z "${dontYarnBuild-}" && -z "${buildPhase-}" ]]; then
|
||||
buildPhase=yarnBuildHook
|
||||
fi
|
@ -987,6 +987,7 @@ with pkgs;
|
||||
fixup-yarn-lock
|
||||
prefetch-yarn-deps
|
||||
yarnConfigHook
|
||||
yarnBuildHook
|
||||
fetchYarnDeps;
|
||||
|
||||
find-cursor = callPackage ../tools/X11/find-cursor { };
|
||||
|
Loading…
Reference in New Issue
Block a user