feat: fixed new build with deps
This commit is contained in:
parent
53c25c9da3
commit
f5009d09bb
1 changed files with 18 additions and 17 deletions
|
|
@ -7,27 +7,28 @@
|
|||
pnpmConfigHook,
|
||||
git,
|
||||
siteUrl,
|
||||
sourcePath ? ./..
|
||||
sourcePath ? ./..,
|
||||
}: let
|
||||
nodejs = nodejs_latest;
|
||||
pnpm = pnpm_10;
|
||||
|
||||
|
||||
# Filter source: use cleanSourceFilter as base, but include .git and exclude _site
|
||||
filteredSrc = lib.cleanSourceWith {
|
||||
src = sourcePath;
|
||||
filter = path: type:
|
||||
let
|
||||
baseName = baseNameOf path;
|
||||
# Always include .git directory
|
||||
isGit = baseName == ".git" || lib.hasInfix "/.git/" path || lib.hasSuffix "/.git" path;
|
||||
in
|
||||
isGit || (
|
||||
# Apply base cleanSourceFilter
|
||||
lib.cleanSourceFilter path type &&
|
||||
# Additional exclusions
|
||||
baseName != "_site" &&
|
||||
baseName != "node_modules"
|
||||
);
|
||||
filter = path: type: let
|
||||
baseName = baseNameOf path;
|
||||
# Always include .git directory
|
||||
isGit = baseName == ".git" || lib.hasInfix "/.git/" path || lib.hasSuffix "/.git" path;
|
||||
in
|
||||
isGit
|
||||
|| (
|
||||
# Apply base cleanSourceFilter
|
||||
lib.cleanSourceFilter path type
|
||||
&&
|
||||
# Additional exclusions
|
||||
baseName != "_site"
|
||||
&& baseName != "node_modules"
|
||||
);
|
||||
};
|
||||
in
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
|
|
@ -48,7 +49,7 @@ in
|
|||
pnpmDeps = fetchPnpmDeps {
|
||||
inherit (finalAttrs) pname version;
|
||||
src = lib.cleanSource sourcePath;
|
||||
hash = "sha256-rN8P6g/Wuug+fv0rm/qbKN01NgcbpgEQmhDFe2X42uA=";
|
||||
hash = "sha256-OaSZ8eY6idDv16BhmOTkOeis19SXjPRg+QUtf68TDQI=";
|
||||
fetcherVersion = 3; # pnpm store version
|
||||
};
|
||||
|
||||
|
|
@ -68,4 +69,4 @@ in
|
|||
|
||||
runHook postInstall
|
||||
'';
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue