akkoma-fe: build using yarn{Config,Build}Hook

This commit is contained in:
Mikael Voss
2025-12-09 14:41:51 +01:00
parent 8aeafd4e79
commit 1f04d8a258
+5 -26
View File
@@ -4,8 +4,8 @@
fetchFromGitea,
fetchYarnDeps,
writableTmpDirAsHomeHook,
fixup-yarn-lock,
yarn,
yarnConfigHook,
yarnBuildHook,
nodejs,
jpegoptim,
oxipng,
@@ -28,15 +28,15 @@ stdenv.mkDerivation (finalAttrs: {
forceFetchGit = true;
};
offlineCache = fetchYarnDeps {
yarnOfflineCache = fetchYarnDeps {
yarnLock = finalAttrs.src + "/yarn.lock";
hash = "sha256-QB523QZX8oBMHWBSFF7MpaWWXc+MgEUaw/2gsCPZ9a4=";
};
nativeBuildInputs = [
writableTmpDirAsHomeHook
fixup-yarn-lock
yarn
yarnConfigHook
yarnBuildHook
nodejs
jpegoptim
oxipng
@@ -51,27 +51,6 @@ stdenv.mkDerivation (finalAttrs: {
build/webpack.prod.conf.js
'';
configurePhase = ''
runHook preConfigure
yarn config --offline set yarn-offline-mirror ${lib.escapeShellArg finalAttrs.offlineCache}
fixup-yarn-lock yarn.lock
yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive
runHook postConfigure
'';
buildPhase = ''
runHook preBuild
export NODE_ENV="production"
export NODE_OPTIONS="--openssl-legacy-provider"
yarn run build --offline
runHook postBuild
'';
installPhase = ''
runHook preInstall