@vercel/static-build 15.0.0 → 17.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +30 -2
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -50455,7 +50455,13 @@ Details: https://err.sh/vercel/vercel/now-static-build-failed-to-detect-a-server
50455
50455
  ];
50456
50456
  (0, import_build_utils4.debug)(`Using ignore: ${JSON.stringify(ignore)}`);
50457
50457
  }
50458
- output = await (0, import_build_utils4.glob)("**", { cwd: distPath, ignore }, mountpoint);
50458
+ output = await collectStaticFiles(
50459
+ distPath,
50460
+ meta,
50461
+ mountpoint,
50462
+ ignore,
50463
+ service?.name
50464
+ );
50459
50465
  Object.assign(output, extraOutputs.functions);
50460
50466
  }
50461
50467
  }
@@ -50465,7 +50471,13 @@ Details: https://err.sh/vercel/vercel/now-static-build-failed-to-detect-a-server
50465
50471
  (0, import_build_utils4.debug)(`Running build script "${entrypoint}"`);
50466
50472
  await (0, import_build_utils4.runShellScript)(import_path6.default.join(workPath, entrypoint));
50467
50473
  validateDistDir(distPath, workPath);
50468
- const output = await (0, import_build_utils4.glob)("**", distPath, mountpoint);
50474
+ const output = await collectStaticFiles(
50475
+ distPath,
50476
+ meta,
50477
+ mountpoint,
50478
+ [],
50479
+ service?.name
50480
+ );
50469
50481
  return {
50470
50482
  output,
50471
50483
  routes: []
@@ -50477,6 +50489,22 @@ Details: https://err.sh/vercel/vercel/now-static-build-failed-to-detect-a-server
50477
50489
  }
50478
50490
  throw new Error(message);
50479
50491
  };
50492
+ async function collectStaticFiles(distPath, meta, mountpoint, ignore = [], serviceName) {
50493
+ if (!meta?.daemonContext)
50494
+ return (0, import_build_utils4.glob)("**", { cwd: distPath, ignore }, mountpoint);
50495
+ const canPublish = await (0, import_build_utils4.createDaemonStaticFileFilter)({
50496
+ context: meta.daemonContext,
50497
+ publishPath: distPath,
50498
+ serviceName
50499
+ });
50500
+ const output = await (0, import_build_utils4.glob)("**", { cwd: distPath, ignore }, mountpoint);
50501
+ for (const [name, file] of Object.entries(output)) {
50502
+ if (file.type === "FileFsRef" && !await canPublish(file.fsPath)) {
50503
+ delete output[name];
50504
+ }
50505
+ }
50506
+ return output;
50507
+ }
50480
50508
  var prepareCache = async ({
50481
50509
  entrypoint,
50482
50510
  repoRootPath,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/static-build",
3
- "version": "15.0.0",
3
+ "version": "17.0.0",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/build-step",
@@ -14,12 +14,12 @@
14
14
  },
15
15
  "dependencies": {
16
16
  "ts-morph": "12.0.0",
17
- "@vercel/static-config": "3.4.4",
18
17
  "@vercel/gatsby-plugin-vercel-analytics": "1.0.12",
19
- "@vercel/gatsby-plugin-vercel-builder": "2.2.65"
18
+ "@vercel/static-config": "3.4.4",
19
+ "@vercel/gatsby-plugin-vercel-builder": "2.2.67"
20
20
  },
21
21
  "peerDependencies": {
22
- "@vercel/build-utils": "14.15.0"
22
+ "@vercel/build-utils": "14.17.0"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/aws-lambda": "8.10.64",
@@ -40,11 +40,11 @@
40
40
  "semver": "7.5.2",
41
41
  "tree-kill": "1.2.2",
42
42
  "vitest": "4.1.10",
43
- "@vercel/build-utils": "14.15.0",
43
+ "@vercel/build-utils": "14.17.0",
44
+ "@vercel/error-utils": "2.2.1",
44
45
  "@vercel/frameworks": "3.35.0",
45
- "@vercel/fs-detectors": "7.9.0",
46
- "@vercel/routing-utils": "6.6.0",
47
- "@vercel/error-utils": "2.2.1"
46
+ "@vercel/fs-detectors": "7.9.2",
47
+ "@vercel/routing-utils": "6.6.0"
48
48
  },
49
49
  "scripts": {
50
50
  "build": "node ../../utils/build-builder.mjs",