@absolutejs/absolute 0.19.0-beta.1125 → 0.19.0-beta.1127

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.
package/dist/cli/index.js CHANGED
@@ -1613,7 +1613,7 @@ var stripStringsAndComments = (source) => {
1613
1613
 
1614
1614
  // node_modules/typescript/lib/typescript.js
1615
1615
  var require_typescript = __commonJS((exports, module) => {
1616
- var __dirname = "/tmp/absolutejs-1125-final.FEhoXu/node_modules/typescript/lib", __filename = "/tmp/absolutejs-1125-final.FEhoXu/node_modules/typescript/lib/typescript.js";
1616
+ var __dirname = "/home/alexkahn/abs/absolutejs/node_modules/typescript/lib", __filename = "/home/alexkahn/abs/absolutejs/node_modules/typescript/lib/typescript.js";
1617
1617
  /*! *****************************************************************************
1618
1618
  Copyright (c) Microsoft Corporation. All rights reserved.
1619
1619
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use
@@ -170811,6 +170811,49 @@ var init_bunStringRawUnicodePlugin = __esm(() => {
170811
170811
  NON_ASCII = /[^\x00-\x7f]/;
170812
170812
  });
170813
170813
 
170814
+ // src/cli/serverBundleExternals.ts
170815
+ var FRAMEWORK_EXTERNALS, collectUserServerExternals = (buildConfig) => {
170816
+ const { bunBuild } = buildConfig;
170817
+ if (!bunBuild)
170818
+ return [];
170819
+ const override = "external" in bunBuild && Array.isArray(bunBuild.external) ? bunBuild.external : [];
170820
+ const defaultBuild = "default" in bunBuild ? bunBuild.default : undefined;
170821
+ const fromDefault = Array.isArray(defaultBuild?.external) ? defaultBuild.external : [];
170822
+ return [...override, ...fromDefault];
170823
+ }, resolveServerBundleExternals = (buildConfig) => [
170824
+ ...FRAMEWORK_EXTERNALS.filter((specifier) => {
170825
+ if (buildConfig.reactDirectory && (specifier === "react" || specifier.startsWith("react/") || specifier.startsWith("react-dom")))
170826
+ return false;
170827
+ if (buildConfig.vueDirectory && (specifier === "vue" || specifier.startsWith("vue/") || specifier === "@vue/server-renderer"))
170828
+ return false;
170829
+ if (buildConfig.svelteDirectory && (specifier === "svelte" || specifier.startsWith("svelte/")))
170830
+ return false;
170831
+ return true;
170832
+ }),
170833
+ ...collectUserServerExternals(buildConfig)
170834
+ ];
170835
+ var init_serverBundleExternals = __esm(() => {
170836
+ FRAMEWORK_EXTERNALS = [
170837
+ "react",
170838
+ "react/jsx-runtime",
170839
+ "react-dom",
170840
+ "react-dom/*",
170841
+ "vue",
170842
+ "vue/*",
170843
+ "@vue/compiler-sfc",
170844
+ "@vue/server-renderer",
170845
+ "svelte",
170846
+ "svelte/*",
170847
+ "@angular/compiler",
170848
+ "@angular/compiler-cli",
170849
+ "@angular/core",
170850
+ "@angular/common",
170851
+ "@angular/platform-browser",
170852
+ "@angular/platform-server",
170853
+ "typescript"
170854
+ ];
170855
+ });
170856
+
170814
170857
  // src/core/prerender.ts
170815
170858
  var exports_prerender = {};
170816
170859
  __export(exports_prerender, {
@@ -178799,26 +178842,7 @@ console.log(\`
178799
178842
  return;
178800
178843
  });
178801
178844
  }
178802
- }), FRAMEWORK_EXTERNALS, collectUserServerExternals = (buildConfig) => {
178803
- const { bunBuild } = buildConfig;
178804
- if (!bunBuild)
178805
- return [];
178806
- const override = "external" in bunBuild && Array.isArray(bunBuild.external) ? bunBuild.external : [];
178807
- const defaultBuild = "default" in bunBuild ? bunBuild.default : undefined;
178808
- const fromDefault = Array.isArray(defaultBuild?.external) ? defaultBuild.external : [];
178809
- return [...override, ...fromDefault];
178810
- }, resolveServerBundleExternals = (buildConfig) => [
178811
- ...FRAMEWORK_EXTERNALS.filter((specifier) => {
178812
- if (buildConfig.reactDirectory && (specifier === "react" || specifier.startsWith("react/") || specifier.startsWith("react-dom")))
178813
- return false;
178814
- if (buildConfig.vueDirectory && (specifier === "vue" || specifier.startsWith("vue/") || specifier === "@vue/server-renderer"))
178815
- return false;
178816
- if (buildConfig.svelteDirectory && (specifier === "svelte" || specifier.startsWith("svelte/")))
178817
- return false;
178818
- return true;
178819
- }),
178820
- ...collectUserServerExternals(buildConfig)
178821
- ], compile = async (serverEntry, outdir, outfile, configPath2) => {
178845
+ }), compile = async (serverEntry, outdir, outfile, configPath2) => {
178822
178846
  const resolvedOutdir = resolve23(outdir ?? "dist");
178823
178847
  await withBuildDirectoryLock(resolvedOutdir, () => compileUnlocked(serverEntry, resolvedOutdir, outfile, configPath2));
178824
178848
  }, compileUnlocked = async (serverEntry, resolvedOutdir, outfile, configPath2) => {
@@ -178988,6 +179012,7 @@ var init_compile = __esm(() => {
178988
179012
  init_loadConfig();
178989
179013
  init_startupBanner();
178990
179014
  init_telemetryEvent();
179015
+ init_serverBundleExternals();
178991
179016
  init_utils();
178992
179017
  INLINE_SOURCE_MAP_RE = /sourceMappingURL=data:application\/json(?:;[^,]+)?;base64,([A-Za-z0-9+/=]+)\s*$/;
178993
179018
  SERVER_RUNTIME_ASSET_RE = /new\s+URL\(\s*["'](\.\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g;
@@ -179013,25 +179038,6 @@ var init_compile = __esm(() => {
179013
179038
  requireForCompile = createRequire3(import.meta.url);
179014
179039
  RUNTIME_JS_EXTENSIONS = [".js", ".mjs", ".cjs"];
179015
179040
  MODULE_SPECIFIER_RE = /(from\s*|import\s*|import\(\s*|require\(\s*)(["'])([^"']+)\2/g;
179016
- FRAMEWORK_EXTERNALS = [
179017
- "react",
179018
- "react/jsx-runtime",
179019
- "react-dom",
179020
- "react-dom/*",
179021
- "vue",
179022
- "vue/*",
179023
- "@vue/compiler-sfc",
179024
- "@vue/server-renderer",
179025
- "svelte",
179026
- "svelte/*",
179027
- "@angular/compiler",
179028
- "@angular/compiler-cli",
179029
- "@angular/core",
179030
- "@angular/common",
179031
- "@angular/platform-browser",
179032
- "@angular/platform-server",
179033
- "typescript"
179034
- ];
179035
179041
  });
179036
179042
 
179037
179043
  // src/cli/scripts/typecheck.ts
@@ -181063,6 +181069,7 @@ init_bunStringRawUnicodePlugin();
181063
181069
  init_loadConfig();
181064
181070
  init_startupBanner();
181065
181071
  init_telemetryEvent();
181072
+ init_serverBundleExternals();
181066
181073
  init_utils();
181067
181074
  var {env: env2 } = globalThis.Bun;
181068
181075
  import { existsSync as existsSync8, readFileSync as readFileSync11, rmSync as rmSync4 } from "fs";
@@ -181156,7 +181163,108 @@ var prerenderStaticPages = async (outputPath, prerenderPort, resolvedOutdir, sta
181156
181163
  console.error(err);
181157
181164
  }
181158
181165
  };
181159
- var start = async (serverEntry, outdir, configPath2) => {
181166
+ var runPreparedServer = async ({
181167
+ absoluteVersion,
181168
+ bundleDurationMs,
181169
+ configPath: configPath2,
181170
+ frameworks: frameworks2,
181171
+ outdir,
181172
+ outputPath,
181173
+ port,
181174
+ prebuilt,
181175
+ resolvedOutdir,
181176
+ serverEntry,
181177
+ totalDuration
181178
+ }) => {
181179
+ const usesDocker = existsSync8(resolve8(COMPOSE_PATH));
181180
+ const scripts = usesDocker ? await readDbScripts() : null;
181181
+ if (scripts)
181182
+ await startDatabase(scripts);
181183
+ let cleaning = false;
181184
+ const sessionStart = Date.now();
181185
+ sendTelemetryEvent("start:start", {
181186
+ buildDurationMs: Math.max(0, Math.round(totalDuration) - bundleDurationMs),
181187
+ bundleDurationMs,
181188
+ entry: serverEntry,
181189
+ frameworks: frameworks2,
181190
+ totalDurationMs: Math.round(totalDuration)
181191
+ });
181192
+ const serverProcess = Bun.spawn(["bun", "run", outputPath], {
181193
+ cwd: process.cwd(),
181194
+ env: {
181195
+ ...process.env,
181196
+ ABSOLUTE_BUILD_DIR: resolvedOutdir,
181197
+ ABSOLUTE_BUILD_DURATION: String(Math.round(totalDuration)),
181198
+ ABSOLUTE_INSTANCE_MANAGED: "1",
181199
+ ABSOLUTE_VERSION: absoluteVersion,
181200
+ FORCE_COLOR: "1",
181201
+ NODE_ENV: "production",
181202
+ ...configPath2 ? { ABSOLUTE_CONFIG: configPath2 } : {}
181203
+ },
181204
+ stderr: "inherit",
181205
+ stdin: "inherit",
181206
+ stdout: "inherit"
181207
+ });
181208
+ const relaunchCommand = [
181209
+ process.execPath,
181210
+ process.argv[1] ?? "",
181211
+ "start",
181212
+ serverEntry,
181213
+ ...outdir ? ["--outdir", outdir] : [],
181214
+ ...configPath2 ? ["--config", configPath2] : [],
181215
+ ...prebuilt ? ["--prebuilt"] : []
181216
+ ].filter((part) => part.length > 0);
181217
+ registerInstance({
181218
+ command: relaunchCommand,
181219
+ configPath: configPath2 ?? null,
181220
+ controllerPid: process.pid,
181221
+ cwd: process.cwd(),
181222
+ frameworks: frameworks2,
181223
+ host: env2.ABSOLUTE_HOST ?? env2.HOST ?? "localhost",
181224
+ https: env2.ABSOLUTE_HTTPS === "true",
181225
+ logFile: null,
181226
+ name: resolveProjectName(process.cwd()),
181227
+ pid: process.pid,
181228
+ port,
181229
+ ppid: process.ppid,
181230
+ source: "start",
181231
+ startedAt: new Date().toISOString()
181232
+ });
181233
+ const cleanup = async (exitCode2 = 0) => {
181234
+ if (cleaning)
181235
+ return;
181236
+ cleaning = true;
181237
+ deregisterInstance(process.pid);
181238
+ sendTelemetryEvent("start:session-duration", {
181239
+ duration: Math.round((Date.now() - sessionStart) / MILLISECONDS_IN_A_SECOND),
181240
+ entry: serverEntry
181241
+ });
181242
+ try {
181243
+ serverProcess.kill();
181244
+ } catch {}
181245
+ await serverProcess.exited;
181246
+ if (scripts)
181247
+ await stopDatabase(scripts);
181248
+ process.exit(exitCode2);
181249
+ };
181250
+ process.on("SIGINT", () => cleanup(0));
181251
+ process.on("SIGTERM", () => cleanup(0));
181252
+ const exitCode = await serverProcess.exited;
181253
+ if (cleaning)
181254
+ return;
181255
+ console.error(cliTag2("\x1B[31m", `Server exited with code ${exitCode}.`));
181256
+ sendTelemetryEvent("start:server-exit", {
181257
+ entry: serverEntry,
181258
+ exitCode
181259
+ });
181260
+ if (scripts)
181261
+ await stopDatabase(scripts);
181262
+ process.exit(exitCode);
181263
+ };
181264
+ var start = async (serverEntry, outdir, configPath2, options = {}) => {
181265
+ if (options.prebuilt && options.prepareOnly) {
181266
+ throw new Error("A production start cannot be prebuilt and prepare-only.");
181267
+ }
181160
181268
  const port = Number(env2.PORT) || DEFAULT_PORT;
181161
181269
  killStaleProcesses(port);
181162
181270
  const entryName = basename3(serverEntry).replace(/\.[^.]+$/, "");
@@ -181165,8 +181273,6 @@ var start = async (serverEntry, outdir, configPath2) => {
181165
181273
  resolve8(import.meta.dir, "..", "..", "..", "package.json"),
181166
181274
  resolve8(import.meta.dir, "..", "..", "package.json")
181167
181275
  ]);
181168
- const buildStepStart = performance.now();
181169
- process.stdout.write(cliTag2("\x1B[36m", `Building assets`));
181170
181276
  const buildConfig = await loadConfig(configPath2);
181171
181277
  buildConfig.buildDirectory = resolvedOutdir;
181172
181278
  buildConfig.mode = "production";
@@ -181178,6 +181284,27 @@ var start = async (serverEntry, outdir, configPath2) => {
181178
181284
  buildConfig.vueDirectory && "vue",
181179
181285
  buildConfig.angularDirectory && "angular"
181180
181286
  ].filter((val) => Boolean(val));
181287
+ const outputPath = resolve8(resolvedOutdir, `${entryName}.js`);
181288
+ if (options.prebuilt) {
181289
+ if (!existsSync8(outputPath)) {
181290
+ throw new Error(`Prepared production server not found: ${outputPath}`);
181291
+ }
181292
+ return runPreparedServer({
181293
+ absoluteVersion,
181294
+ bundleDurationMs: 0,
181295
+ configPath: configPath2,
181296
+ frameworks: frameworks2,
181297
+ outdir,
181298
+ outputPath,
181299
+ port,
181300
+ prebuilt: true,
181301
+ resolvedOutdir,
181302
+ serverEntry,
181303
+ totalDuration: 0
181304
+ });
181305
+ }
181306
+ const buildStepStart = performance.now();
181307
+ process.stdout.write(cliTag2("\x1B[36m", `Building assets`));
181181
181308
  try {
181182
181309
  const build = await resolveBuildModule([
181183
181310
  resolve8(import.meta.dir, "..", "..", "core", "build"),
@@ -181267,25 +181394,7 @@ var start = async (serverEntry, outdir, configPath2) => {
181267
181394
  const serverBundle = await Bun.build({
181268
181395
  define: { "process.env.NODE_ENV": '"production"' },
181269
181396
  entrypoints: [resolve8(serverEntry)],
181270
- external: [
181271
- "react",
181272
- "react/jsx-runtime",
181273
- "react-dom",
181274
- "react-dom/*",
181275
- "vue",
181276
- "vue/*",
181277
- "@vue/compiler-sfc",
181278
- "@vue/server-renderer",
181279
- "svelte",
181280
- "svelte/*",
181281
- "@angular/compiler",
181282
- "@angular/compiler-cli",
181283
- "@angular/core",
181284
- "@angular/common",
181285
- "@angular/platform-browser",
181286
- "@angular/platform-server",
181287
- "typescript"
181288
- ],
181397
+ external: resolveServerBundleExternals(buildConfig),
181289
181398
  outdir: resolvedOutdir,
181290
181399
  plugins: [
181291
181400
  ...islandRegistryPlugin ? [islandRegistryPlugin] : [],
@@ -181298,7 +181407,6 @@ var start = async (serverEntry, outdir, configPath2) => {
181298
181407
  if (!serverBundle.success) {
181299
181408
  handleBundleFailure(serverBundle, bundleStart, serverEntry);
181300
181409
  }
181301
- const outputPath = resolve8(resolvedOutdir, `${entryName}.js`);
181302
181410
  if (!existsSync8(outputPath)) {
181303
181411
  console.error(cliTag2("\x1B[31m", `Expected output not found: ${outputPath}`));
181304
181412
  process.exit(1);
@@ -181333,91 +181441,27 @@ var start = async (serverEntry, outdir, configPath2) => {
181333
181441
  if (buildConfig.static) {
181334
181442
  await prerenderStaticPages(outputPath, port + 1, resolvedOutdir, buildConfig.static, absoluteVersion, configPath2);
181335
181443
  }
181336
- const usesDocker = existsSync8(resolve8(COMPOSE_PATH));
181337
- const scripts = usesDocker ? await readDbScripts() : null;
181338
- if (scripts)
181339
- await startDatabase(scripts);
181340
- let cleaning = false;
181341
- const sessionStart = Date.now();
181342
181444
  const totalDuration = performance.now() - buildStepStart;
181343
- sendTelemetryEvent("start:start", {
181344
- buildDurationMs: Math.round(performance.now() - buildStepStart) - bundleDurationMs,
181345
- bundleDurationMs,
181346
- entry: serverEntry,
181347
- frameworks: frameworks2,
181348
- totalDurationMs: Math.round(totalDuration)
181349
- });
181350
- const serverProcess = Bun.spawn(["bun", "run", outputPath], {
181351
- cwd: process.cwd(),
181352
- env: {
181353
- ...process.env,
181354
- ABSOLUTE_BUILD_DIR: resolvedOutdir,
181355
- ABSOLUTE_BUILD_DURATION: String(Math.round(totalDuration)),
181356
- ABSOLUTE_INSTANCE_MANAGED: "1",
181357
- ABSOLUTE_VERSION: absoluteVersion,
181358
- FORCE_COLOR: "1",
181359
- NODE_ENV: "production",
181360
- ...configPath2 ? { ABSOLUTE_CONFIG: configPath2 } : {}
181361
- },
181362
- stderr: "inherit",
181363
- stdin: "inherit",
181364
- stdout: "inherit"
181365
- });
181366
- const relaunchCommand = [
181367
- process.execPath,
181368
- process.argv[1] ?? "",
181369
- "start",
181370
- serverEntry,
181371
- ...outdir ? ["--outdir", outdir] : [],
181372
- ...configPath2 ? ["--config", configPath2] : []
181373
- ].filter((part) => part.length > 0);
181374
- registerInstance({
181375
- command: relaunchCommand,
181376
- configPath: configPath2 ?? null,
181377
- controllerPid: process.pid,
181378
- cwd: process.cwd(),
181379
- frameworks: frameworks2,
181380
- host: env2.ABSOLUTE_HOST ?? env2.HOST ?? "localhost",
181381
- https: env2.ABSOLUTE_HTTPS === "true",
181382
- logFile: null,
181383
- name: resolveProjectName(process.cwd()),
181384
- pid: process.pid,
181385
- port,
181386
- ppid: process.ppid,
181387
- source: "start",
181388
- startedAt: new Date().toISOString()
181389
- });
181390
- const cleanup = async (exitCode2 = 0) => {
181391
- if (cleaning)
181392
- return;
181393
- cleaning = true;
181394
- deregisterInstance(process.pid);
181395
- sendTelemetryEvent("start:session-duration", {
181396
- duration: Math.round((Date.now() - sessionStart) / MILLISECONDS_IN_A_SECOND),
181445
+ if (options.prepareOnly) {
181446
+ sendTelemetryEvent("prepare:complete", {
181447
+ durationMs: Math.round(totalDuration),
181397
181448
  entry: serverEntry
181398
181449
  });
181399
- try {
181400
- serverProcess.kill();
181401
- } catch {}
181402
- await serverProcess.exited;
181403
- if (scripts)
181404
- await stopDatabase(scripts);
181405
- process.exit(exitCode2);
181406
- };
181407
- process.on("SIGINT", () => cleanup(0));
181408
- process.on("SIGTERM", () => cleanup(0));
181409
- const exitCode = await serverProcess.exited;
181410
- if (cleaning) {
181411
181450
  return;
181412
181451
  }
181413
- console.error(cliTag2("\x1B[31m", `Server exited with code ${exitCode}.`));
181414
- sendTelemetryEvent("start:server-exit", {
181415
- entry: serverEntry,
181416
- exitCode
181452
+ return runPreparedServer({
181453
+ absoluteVersion,
181454
+ bundleDurationMs,
181455
+ configPath: configPath2,
181456
+ frameworks: frameworks2,
181457
+ outdir,
181458
+ outputPath,
181459
+ port,
181460
+ prebuilt: false,
181461
+ resolvedOutdir,
181462
+ serverEntry,
181463
+ totalDuration
181417
181464
  });
181418
- if (scripts)
181419
- await stopDatabase(scripts);
181420
- process.exit(exitCode);
181421
181465
  };
181422
181466
 
181423
181467
  // src/cli/scripts/workspace.ts
@@ -182805,12 +182849,21 @@ if (command === "dev") {
182805
182849
  const serverEntry = positionalArgs2[0] ?? DEFAULT_SERVER_ENTRY;
182806
182850
  await dev(serverEntry, configPath2);
182807
182851
  } else if (command === "start") {
182852
+ sendTelemetryEvent("cli:command", { command });
182853
+ const outdir = parseNamedArg("--outdir");
182854
+ const configPath2 = parseNamedArg("--config");
182855
+ const positionalArgs2 = stripNamedArgs("--outdir", "--config").filter((arg) => arg !== "--prebuilt");
182856
+ const serverEntry = positionalArgs2[0] ?? DEFAULT_SERVER_ENTRY;
182857
+ await start(serverEntry, outdir, configPath2, {
182858
+ prebuilt: args.includes("--prebuilt")
182859
+ });
182860
+ } else if (command === "prepare") {
182808
182861
  sendTelemetryEvent("cli:command", { command });
182809
182862
  const outdir = parseNamedArg("--outdir");
182810
182863
  const configPath2 = parseNamedArg("--config");
182811
182864
  const positionalArgs2 = stripNamedArgs("--outdir", "--config");
182812
182865
  const serverEntry = positionalArgs2[0] ?? DEFAULT_SERVER_ENTRY;
182813
- await start(serverEntry, outdir, configPath2);
182866
+ await start(serverEntry, outdir, configPath2, { prepareOnly: true });
182814
182867
  } else if (command === "build") {
182815
182868
  sendTelemetryEvent("cli:command", { command });
182816
182869
  const outdir = parseNamedArg("--outdir");
@@ -182943,7 +182996,8 @@ if (command === "dev") {
182943
182996
  console.error(" dev [entry] Start development server");
182944
182997
  console.error(" workspace dev [--no-tui] Start multi-service workspace dev");
182945
182998
  console.error(" build [--outdir dir] [--profile] Build production assets");
182946
- console.error(" start [entry] [--outdir dir] Start production server");
182999
+ console.error(" prepare [entry] [--outdir dir] Build production assets and server without launching");
183000
+ console.error(" start [entry] [--outdir dir] [--prebuilt] Start production server");
182947
183001
  console.error(" compile [entry] [--outdir dir] [--outfile path] Compile standalone executable");
182948
183002
  console.error(" config [--port n] Open the unified config UI (ESLint, tsconfig, Prettier)");
182949
183003
  console.error(" db <backup|restore|seed> Backup/restore any Postgres DB (ORM-agnostic, upsert by PK) or run the seed script");
package/dist/index.js CHANGED
@@ -21582,8 +21582,8 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY, OPTIMIZATION_END
21582
21582
  const device = config2?.deviceSizes ?? DEFAULT_DEVICE_SIZES;
21583
21583
  const image2 = config2?.imageSizes ?? DEFAULT_IMAGE_SIZES;
21584
21584
  return [...device, ...image2].sort((left, right) => left - right);
21585
- }, getCacheDir = (buildDir) => {
21586
- const dir = join20(buildDir, ".cache", "images");
21585
+ }, getCacheDir = (buildDir, cacheDirectory) => {
21586
+ const dir = cacheDirectory ? resolve16(cacheDirectory) : join20(buildDir, ".cache", "images");
21587
21587
  if (!existsSync17(dir))
21588
21588
  mkdirSync3(dir, { recursive: true });
21589
21589
  return dir;
@@ -29543,7 +29543,7 @@ var init_fastHmrCompiler = __esm(() => {
29543
29543
 
29544
29544
  // node_modules/content-tag/pkg/node/content_tag.cjs
29545
29545
  var require_content_tag = __commonJS((exports, module) => {
29546
- var __dirname = "/tmp/absolutejs-1125-final.FEhoXu/node_modules/content-tag/pkg/node";
29546
+ var __dirname = "/home/alexkahn/abs/absolutejs/node_modules/content-tag/pkg/node";
29547
29547
  var imports = {};
29548
29548
  imports["__wbindgen_placeholder__"] = exports;
29549
29549
  var wasm;
@@ -39399,7 +39399,7 @@ var DEFAULT_CACHE_TTL_SECONDS = 60, MS_PER_SECOND = 1000, MAX_QUALITY = 100, avi
39399
39399
  const cacheControlHeader = `public, max-age=${Math.ceil(minimumCacheTTL / MS_PER_SECOND)}, must-revalidate`;
39400
39400
  const configuredFormats = config2?.formats ?? ["webp"];
39401
39401
  const remotePatterns = config2?.remotePatterns ?? [];
39402
- const cacheDir = getCacheDir(buildDir);
39402
+ const cacheDir = getCacheDir(buildDir, config2?.cacheDirectory);
39403
39403
  return plugin.get(endpointPath, async ({ query, request }) => {
39404
39404
  const parsed = parseQueryParams(query, allowedSizes, defaultQuality);
39405
39405
  if ("error" in parsed)
@@ -48043,5 +48043,5 @@ export {
48043
48043
  ANGULAR_INIT_TIMEOUT_MS
48044
48044
  };
48045
48045
 
48046
- //# debugId=F089454049B3B81D64756E2164756E21
48046
+ //# debugId=C88B0B763C496EAA64756E2164756E21
48047
48047
  //# sourceMappingURL=index.js.map