@gigadrive/network-config 3.4.17 → 4.1.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.
package/dist/index.mjs CHANGED
@@ -268,10 +268,9 @@ var isJsonValue = (value) => {
268
268
  if (Array.isArray(value)) return value.every(isJsonValue);
269
269
  return isRecord2(value) && Object.values(value).every(isJsonValue);
270
270
  };
271
- var isRouteOutput = (value) => isRecord2(value) && typeof value.id === "string" && ["PAGES", "PAGES_API", "APP_PAGE", "APP_ROUTE", "MIDDLEWARE"].includes(String(value.type)) && isPortableRelativePath(value.filePath) && typeof value.pathname === "string" && typeof value.sourcePage === "string" && (value.runtime === "nodejs" || value.runtime === "edge") && isStringRecord(value.assets) && isRecord2(value.config);
272
271
  var isPrerenderOutput = (value) => isRecord2(value) && value.type === "PRERENDER" && typeof value.id === "string" && typeof value.pathname === "string" && typeof value.parentOutputId === "string" && typeof value.groupId === "number" && isRecord2(value.config) && (value.fallback === void 0 || isRecord2(value.fallback) && (value.fallback.filePath === void 0 || isPortableRelativePath(value.fallback.filePath)));
273
- var isStaticOutput = (value) => isRecord2(value) && value.type === "STATIC_FILE" && typeof value.id === "string" && typeof value.pathname === "string" && isPortableRelativePath(value.filePath);
274
- var isEntrypoint = (value) => isRecord2(value) && typeof value.id === "string" && (value.runtime === "nodejs" || value.runtime === "edge") && isPortableRelativePath(value.filePath) && Array.isArray(value.outputIds) && value.outputIds.every((item) => typeof item === "string") && isStringRecord(value.assets) && isRecord2(value.config);
272
+ var isStaticAssetPrefix = (value) => isRecord2(value) && isPortableRelativePath(value.sourceDir) && isPortableRelativePath(value.urlPrefix) && typeof value.immutable === "boolean";
273
+ var isServerDescriptor = (value) => isRecord2(value) && (value.maxDuration === void 0 || typeof value.maxDuration === "number") && (value.preferredRegion === void 0 || typeof value.preferredRegion === "string" || Array.isArray(value.preferredRegion) && value.preferredRegion.every((region) => typeof region === "string")) && (value.env === void 0 || isStringRecord(value.env));
275
274
  var isImagePolicy = (value) => isRecord2(value) && Array.isArray(value.localPatterns) && Array.isArray(value.remotePatterns) && value.remotePatterns.every((pattern) => isRecord2(pattern) && typeof pattern.hostname === "string") && Array.isArray(value.widths) && value.widths.every((item) => typeof item === "number" && Number.isInteger(item) && item > 0) && Array.isArray(value.heights) && value.heights.every((item) => typeof item === "number" && Number.isInteger(item) && item > 0) && Array.isArray(value.qualities) && value.qualities.every((item) => typeof item === "number" && item >= 1 && item <= 100) && Array.isArray(value.formats) && value.formats.every((item) => ["image/avif", "image/webp", "image/jpeg", "image/png"].includes(String(item))) && typeof value.minimumCacheTTL === "number" && typeof value.dangerouslyAllowSVG === "boolean" && typeof value.contentSecurityPolicy === "string" && (value.contentDispositionType === "inline" || value.contentDispositionType === "attachment") && typeof value.maximumRedirects === "number" && typeof value.maximumResponseBody === "number" && isRecord2(value.variants);
276
275
  var parseGigadriveNextBuildManifest = (content) => {
277
276
  try {
@@ -283,20 +282,83 @@ var parseGigadriveNextBuildManifest = (content) => {
283
282
  }
284
283
  return value;
285
284
  }
286
- if (value.version !== 2 || value.mode !== "adapter-v2" && value.mode !== "export" || !isPortableRelativePath(value.distDir) || !isPortableRelativePath(value.repoRootToProject, true) || typeof value.nextVersion !== "string" || typeof value.buildId !== "string" || !isRecord2(value.config) || typeof value.config.basePath !== "string" || typeof value.config.trailingSlash !== "boolean" || typeof value.config.cacheComponents !== "boolean" || value.config.images !== void 0 && !isImagePolicy(value.config.images) || !isRecord2(value.routing) || !isJsonValue(value.routing) || !isRecord2(value.outputs) || !Array.isArray(value.outputs.pages) || !value.outputs.pages.every(isRouteOutput) || !Array.isArray(value.outputs.pagesApi) || !value.outputs.pagesApi.every(isRouteOutput) || !Array.isArray(value.outputs.appPages) || !value.outputs.appPages.every(isRouteOutput) || !Array.isArray(value.outputs.appRoutes) || !value.outputs.appRoutes.every(isRouteOutput) || !Array.isArray(value.outputs.prerenders) || !value.outputs.prerenders.every(isPrerenderOutput) || !Array.isArray(value.outputs.staticFiles) || !value.outputs.staticFiles.every(isStaticOutput) || value.outputs.middleware !== void 0 && !isRouteOutput(value.outputs.middleware) || !Array.isArray(value.entrypoints) || !value.entrypoints.every(isEntrypoint) || !isStringRecord(value.outputEntrypoints)) {
285
+ if (value.version === 2) {
286
+ if (!isPortableRelativePath(value.distDir) || !isPortableRelativePath(value.repoRootToProject, true) || typeof value.nextVersion !== "string" || typeof value.buildId !== "string") {
287
+ return void 0;
288
+ }
289
+ if (value.mode === "export") {
290
+ return value;
291
+ }
292
+ if (value.mode === "standalone-v2") {
293
+ if (!isServerDescriptor(value.server) || !isRecord2(value.config) || typeof value.config.basePath !== "string" || typeof value.config.trailingSlash !== "boolean" || typeof value.config.cacheComponents !== "boolean" || value.config.images !== void 0 && !isImagePolicy(value.config.images) || !isRecord2(value.routing) || !isJsonValue(value.routing) || !isRecord2(value.outputs) || !Array.isArray(value.outputs.prerenders) || !value.outputs.prerenders.every(isPrerenderOutput) || !Array.isArray(value.outputs.staticAssets) || !value.outputs.staticAssets.every(isStaticAssetPrefix)) {
294
+ return void 0;
295
+ }
296
+ return value;
297
+ }
287
298
  return void 0;
288
299
  }
289
- const entrypointIds = new Set(value.entrypoints.map((item) => item.id));
290
- if (Object.values(value.outputEntrypoints).some((entrypointId) => !entrypointIds.has(entrypointId)))
291
- return void 0;
292
- return value;
300
+ return void 0;
293
301
  } catch {
294
302
  return void 0;
295
303
  }
296
304
  };
297
305
 
306
+ // src/regions.ts
307
+ var REGION_DEFINITIONS = [
308
+ "us-east-1",
309
+ "us-east-2",
310
+ "us-west-1",
311
+ "us-west-2",
312
+ "ap-south-1",
313
+ "ap-northeast-3",
314
+ "ap-northeast-2",
315
+ "ap-southeast-1",
316
+ "ap-southeast-2",
317
+ "ap-northeast-1",
318
+ "ca-central-1",
319
+ "eu-central-1",
320
+ "eu-west-1",
321
+ "eu-west-2",
322
+ "eu-west-3",
323
+ "eu-north-1",
324
+ "sa-east-1"
325
+ ];
326
+ var AVAILABLE_REGIONS = [...REGION_DEFINITIONS];
327
+
298
328
  // src/detection/frameworks/nextjs.ts
299
329
  var toPortablePath = (value) => value.replaceAll("\\", "/");
330
+ var MAXIMUM_ENTRY_PAGE_PATHS = 50;
331
+ var resolveStandaloneServer = Effect4.fn("nextjs.resolveStandaloneServer")(function* (projectFolder, distDir, repoRootToProject) {
332
+ const fs = yield* FileSystem4.FileSystem;
333
+ const pathService = yield* Path3.Path;
334
+ const standaloneRoot = pathService.join(projectFolder, distDir, "standalone");
335
+ const monorepoServer = pathService.join(standaloneRoot, repoRootToProject, "server.js");
336
+ const rootServer = pathService.join(standaloneRoot, "server.js");
337
+ const monorepoServerExists = yield* fs.exists(monorepoServer).pipe(Effect4.catchAll(() => Effect4.succeed(false)));
338
+ const serverPath = monorepoServerExists ? monorepoServer : rootServer;
339
+ const serverExists = yield* fs.exists(serverPath).pipe(Effect4.catchAll(() => Effect4.succeed(false)));
340
+ if (!serverExists) return void 0;
341
+ const serverDirectory = pathService.dirname(serverPath);
342
+ const entrypoint = toPortablePath(pathService.relative(standaloneRoot, serverPath));
343
+ return { standaloneRoot, serverDirectory, entrypoint };
344
+ });
345
+ var buildStandalonePublicAssets = Effect4.fn("nextjs.buildStandalonePublicAssets")(function* (projectFolder, standaloneRoot, serverDirectory) {
346
+ const pathService = yield* Path3.Path;
347
+ const publicFiles = yield* getDefaultPathMap(pathService.join(projectFolder, "public"));
348
+ const assetPaths = [];
349
+ const assetOverrides = {};
350
+ const filePathMap = {};
351
+ for (const [absolutePath, relativePath] of Object.entries(publicFiles)) {
352
+ const portableRelativePath = toPortablePath(relativePath);
353
+ const projectRelativePath = toPortablePath(pathService.relative(projectFolder, absolutePath));
354
+ assetPaths.push(projectRelativePath);
355
+ assetOverrides[projectRelativePath] = { path: portableRelativePath };
356
+ filePathMap[absolutePath] = toPortablePath(
357
+ pathService.relative(standaloneRoot, pathService.join(serverDirectory, "public", relativePath))
358
+ );
359
+ }
360
+ return { assetPaths, assetOverrides, filePathMap };
361
+ });
300
362
  var createStaticExportConfig = Effect4.fn("nextjs.createStaticExportConfig")(function* (defaults, projectFolder) {
301
363
  const pathService = yield* Path3.Path;
302
364
  const outputDirectory = pathService.join(projectFolder, "out");
@@ -322,35 +384,15 @@ var createStaticExportConfig = Effect4.fn("nextjs.createStaticExportConfig")(fun
322
384
  };
323
385
  });
324
386
  var createStandaloneConfig = Effect4.fn("nextjs.createStandaloneConfig")(function* (defaults, projectFolder, manifest) {
325
- const fs = yield* FileSystem4.FileSystem;
326
387
  const pathService = yield* Path3.Path;
327
- const standaloneRoot = pathService.join(projectFolder, manifest.distDir, "standalone");
328
- const monorepoServer = pathService.join(standaloneRoot, manifest.repoRootToProject, "server.js");
329
- const rootServer = pathService.join(standaloneRoot, "server.js");
330
- const monorepoServerExists = yield* fs.exists(monorepoServer).pipe(Effect4.catchAll(() => Effect4.succeed(false)));
331
- const serverPath = monorepoServerExists ? monorepoServer : rootServer;
332
- const serverExists = yield* fs.exists(serverPath).pipe(Effect4.catchAll(() => Effect4.succeed(false)));
333
- if (!serverExists) return defaults;
334
- const serverDirectory = pathService.dirname(serverPath);
335
- const entrypoint = toPortablePath(pathService.relative(standaloneRoot, serverPath));
336
- const publicDirectory = pathService.join(projectFolder, "public");
337
- const staticDirectory = pathService.join(projectFolder, manifest.distDir, "static");
338
- const [publicFiles, staticFiles] = yield* Effect4.all([
339
- getDefaultPathMap(publicDirectory),
340
- getDefaultPathMap(staticDirectory)
341
- ]);
342
- const assetPaths = [];
343
- const assetOverrides = {};
344
- const filePathMap = {};
345
- for (const [absolutePath, relativePath] of Object.entries(publicFiles)) {
346
- const portableRelativePath = toPortablePath(relativePath);
347
- const projectRelativePath = toPortablePath(pathService.relative(projectFolder, absolutePath));
348
- assetPaths.push(projectRelativePath);
349
- assetOverrides[projectRelativePath] = { path: portableRelativePath };
350
- filePathMap[absolutePath] = toPortablePath(
351
- pathService.relative(standaloneRoot, pathService.join(serverDirectory, "public", relativePath))
352
- );
353
- }
388
+ const resolved = yield* resolveStandaloneServer(projectFolder, manifest.distDir, manifest.repoRootToProject);
389
+ if (!resolved) return defaults;
390
+ const { standaloneRoot, serverDirectory, entrypoint } = resolved;
391
+ const publicAssets = yield* buildStandalonePublicAssets(projectFolder, standaloneRoot, serverDirectory);
392
+ const assetPaths = [...publicAssets.assetPaths];
393
+ const assetOverrides = { ...publicAssets.assetOverrides };
394
+ const filePathMap = { ...publicAssets.filePathMap };
395
+ const staticFiles = yield* getDefaultPathMap(pathService.join(projectFolder, manifest.distDir, "static"));
354
396
  for (const [absolutePath, relativePath] of Object.entries(staticFiles)) {
355
397
  const portableRelativePath = toPortablePath(relativePath);
356
398
  const projectRelativePath = toPortablePath(pathService.relative(projectFolder, absolutePath));
@@ -375,116 +417,58 @@ var createStandaloneConfig = Effect4.fn("nextjs.createStandaloneConfig")(functio
375
417
  }
376
418
  };
377
419
  });
378
- var createAdapterV2Config = Effect4.fn("nextjs.createAdapterV2Config")(function* (defaults, projectFolder, manifest) {
379
- const pathService = yield* Path3.Path;
380
- let repoRoot = projectFolder;
381
- if (manifest.repoRootToProject !== ".") {
382
- repoRoot = manifest.repoRootToProject.split("/").reduce((root) => pathService.dirname(root), repoRoot);
383
- }
384
- const artifactUseCount = /* @__PURE__ */ new Map();
385
- for (const entrypoint of manifest.entrypoints) {
386
- for (const [targetPath, sourcePath] of Object.entries(entrypoint.assets)) {
387
- const identity = `${targetPath}\0${sourcePath}`;
388
- artifactUseCount.set(identity, (artifactUseCount.get(identity) ?? 0) + 1);
389
- }
390
- }
391
- const sharedFilePathMap = {};
392
- for (const [identity, useCount] of artifactUseCount) {
393
- if (useCount < 2) continue;
394
- const [targetPath, sourcePath] = identity.split("\0");
395
- sharedFilePathMap[pathService.join(repoRoot, sourcePath)] = targetPath;
396
- }
397
- const sharedArtifacts = Object.keys(sharedFilePathMap).length > 0 ? [{ id: "next-shared", filePathMap: sharedFilePathMap }] : [];
398
- const executablePathByOutputId = new Map(
399
- [
400
- ...manifest.outputs.pages,
401
- ...manifest.outputs.pagesApi,
402
- ...manifest.outputs.appPages,
403
- ...manifest.outputs.appRoutes,
404
- ...manifest.outputs.middleware ? [manifest.outputs.middleware] : []
405
- ].map((output) => [output.id, output.edgeRuntime?.modulePath ?? output.filePath])
406
- );
407
- const entrypoints = manifest.entrypoints.map((entrypoint) => {
408
- const filePathMap = {};
409
- for (const [targetPath, sourcePath] of Object.entries({
410
- ...entrypoint.assets,
411
- ...entrypoint.wasmAssets
412
- })) {
413
- const identity = `${targetPath}\0${sourcePath}`;
414
- if ((artifactUseCount.get(identity) ?? 0) >= 2) continue;
415
- filePathMap[pathService.join(repoRoot, sourcePath)] = targetPath;
416
- }
417
- for (const executablePath of new Set(
418
- entrypoint.outputIds.flatMap((outputId) => {
419
- const executablePath2 = executablePathByOutputId.get(outputId);
420
- return executablePath2 ? [executablePath2] : [];
421
- })
422
- )) {
423
- filePathMap[pathService.join(repoRoot, executablePath)] = executablePath;
420
+ var createStandaloneV2Config = Effect4.fn("nextjs.createStandaloneV2Config")(function* (defaults, projectFolder, manifest) {
421
+ const resolved = yield* resolveStandaloneServer(projectFolder, manifest.distDir, manifest.repoRootToProject);
422
+ if (!resolved) return defaults;
423
+ const { standaloneRoot, serverDirectory, entrypoint } = resolved;
424
+ const publicAssets = yield* buildStandalonePublicAssets(projectFolder, standaloneRoot, serverDirectory);
425
+ const assetPaths = [...publicAssets.assetPaths];
426
+ const assetOverrides = { ...publicAssets.assetOverrides };
427
+ const filePathMap = { ...publicAssets.filePathMap };
428
+ const assetPrefixes = manifest.outputs.staticAssets.map((staticAsset) => ({
429
+ source: staticAsset.sourceDir,
430
+ destination: staticAsset.urlPrefix,
431
+ immutable: staticAsset.immutable,
432
+ populateCache: true
433
+ }));
434
+ const entryPagePaths = [
435
+ ...new Set(
436
+ manifest.outputs.prerenders.filter((output) => !output.fallback?.postponedState).map((output) => output.pathname).filter((pathname) => pathname.startsWith("/") && !pathname.includes("["))
437
+ )
438
+ ].sort((left, right) => left.split("/").length - right.split("/").length || left.localeCompare(right)).slice(0, MAXIMUM_ENTRY_PAGE_PATHS);
439
+ const singleEntrypoint = {
440
+ displayName: "next-server",
441
+ path: entrypoint,
442
+ runtime: defaults.runtime,
443
+ memory: defaults.memory,
444
+ maxDuration: manifest.server.maxDuration ?? defaults.maxDuration,
445
+ streaming: true,
446
+ environmentVariables: {
447
+ NEXT_BUILD_ID: manifest.buildId,
448
+ ...manifest.server.env
449
+ },
450
+ package: {
451
+ trace: false,
452
+ rootOverwrite: standaloneRoot,
453
+ filePathMap
424
454
  }
425
- filePathMap[pathService.join(repoRoot, entrypoint.filePath)] = entrypoint.filePath;
426
- return {
427
- displayName: entrypoint.id,
428
- path: entrypoint.filePath,
429
- runtime: "node-22",
430
- memory: defaults.memory,
431
- maxDuration: entrypoint.config.maxDuration ?? defaults.maxDuration,
432
- streaming: true,
433
- environmentVariables: {
434
- GIGADRIVE_NEXT_ENTRYPOINT_ID: entrypoint.id,
435
- GIGADRIVE_NEXT_RUNTIME: entrypoint.runtime,
436
- NEXT_BUILD_ID: manifest.buildId,
437
- ...entrypoint.config.env
438
- },
439
- package: {
440
- trace: false,
441
- includeProjectFiles: false,
442
- preserveSymlinks: true,
443
- rootOverwrite: repoRoot,
444
- filePathMap,
445
- ...sharedArtifacts.length > 0 ? { sharedArtifactIds: sharedArtifacts.map((artifact) => artifact.id) } : {}
446
- }
447
- };
448
- });
449
- const assetPaths = [];
450
- const assetOverrides = {};
451
- const publicFiles = yield* getDefaultPathMap(pathService.join(projectFolder, "public"));
452
- for (const [absolutePath, relativePath] of Object.entries(publicFiles)) {
453
- const projectRelativePath = toPortablePath(pathService.relative(projectFolder, absolutePath));
454
- assetPaths.push(projectRelativePath);
455
- assetOverrides[projectRelativePath] = { path: toPortablePath(relativePath) };
456
- }
457
- for (const output of manifest.outputs.staticFiles) {
458
- const absolutePath = pathService.join(repoRoot, output.filePath);
459
- const projectRelativePath = toPortablePath(pathService.relative(projectFolder, absolutePath));
460
- if (projectRelativePath.startsWith("../")) continue;
461
- assetPaths.push(projectRelativePath);
462
- assetOverrides[projectRelativePath] = { path: output.pathname.replace(/^\//, "") };
463
- }
464
- const prerenders = manifest.outputs.prerenders.map((output) => {
465
- if (!output.fallback?.filePath) return output;
466
- const absolutePath = pathService.join(repoRoot, output.fallback.filePath);
467
- const projectRelativePath = toPortablePath(pathService.relative(projectFolder, absolutePath));
468
- if (projectRelativePath.startsWith("../")) return output;
469
- const internalAssetPath = `_gigadrive/prerender/${encodeURIComponent(output.id)}.html`;
470
- assetPaths.push(projectRelativePath);
471
- assetOverrides[projectRelativePath] = { path: internalAssetPath };
472
- return {
473
- ...output,
474
- fallback: { ...output.fallback, filePath: `/${internalAssetPath}` }
475
- };
476
- });
455
+ };
477
456
  const framework = {
478
457
  mode: manifest.mode,
479
458
  distDir: manifest.distDir,
480
459
  repoRootToProject: manifest.repoRootToProject,
481
460
  nextVersion: manifest.nextVersion,
482
461
  buildId: manifest.buildId,
462
+ server: manifest.server,
483
463
  config: manifest.config,
484
464
  routing: manifest.routing,
485
- outputs: manifest.outputs,
486
- entrypoints: manifest.entrypoints,
487
- outputEntrypoints: manifest.outputEntrypoints
465
+ // The prerender table is deliberately not forwarded: the standalone server
466
+ // serves build-time prerenders from its own bundle, so the platform only
467
+ // needs the warming sample below.
468
+ outputs: { prerenders: [], staticAssets: manifest.outputs.staticAssets },
469
+ entryPagePaths,
470
+ type: "nextjs",
471
+ schemaVersion: 2
488
472
  };
489
473
  return {
490
474
  ...defaults,
@@ -492,22 +476,27 @@ var createAdapterV2Config = Effect4.fn("nextjs.createAdapterV2Config")(function*
492
476
  routes: [],
493
477
  assetPaths,
494
478
  assetOverrides,
479
+ assetPrefixes,
495
480
  assetsDir: manifest.distDir,
496
481
  assetsPrefixToStrip: "",
482
+ populateAssetCache: true,
497
483
  package: void 0,
498
484
  normalizedConfig: {
499
- regions: ["us-east-1"],
500
- entrypoints,
501
- routes: [],
502
- framework: {
503
- ...framework,
504
- outputs: { ...framework.outputs, prerenders },
505
- type: "nextjs",
506
- schemaVersion: 2
507
- },
485
+ regions: [...AVAILABLE_REGIONS],
486
+ entrypoints: [singleEntrypoint],
487
+ routes: [
488
+ {
489
+ path: "/*",
490
+ destination: entrypoint,
491
+ handler: "SERVERLESS_FUNCTION_STREAMING",
492
+ methods: ["ANY"],
493
+ headers: {}
494
+ }
495
+ ],
496
+ framework,
508
497
  images: manifest.config.images,
509
- sharedArtifacts,
510
- userArchive: { rootOverwrite: repoRoot }
498
+ sharedArtifacts: [],
499
+ userArchive: { rootOverwrite: standaloneRoot }
511
500
  }
512
501
  };
513
502
  });
@@ -535,7 +524,7 @@ var nextjs = {
535
524
  const manifest = manifestContent ? parseGigadriveNextBuildManifest(manifestContent) : void 0;
536
525
  if (!manifest) return defaults;
537
526
  if (manifest.version === 2) {
538
- return manifest.mode === "export" ? yield* createStaticExportConfig(defaults, projectFolder) : yield* createAdapterV2Config(defaults, projectFolder, manifest);
527
+ return manifest.mode === "export" ? yield* createStaticExportConfig(defaults, projectFolder) : yield* createStandaloneV2Config(defaults, projectFolder, manifest);
539
528
  }
540
529
  return manifest.output === "export" ? yield* createStaticExportConfig(defaults, projectFolder) : yield* createStandaloneConfig(defaults, projectFolder, manifest);
541
530
  })
@@ -696,30 +685,6 @@ var FRAMEWORK_DEFINITIONS = [
696
685
 
697
686
  // src/detection/generate-config.ts
698
687
  import { Effect as Effect6 } from "effect";
699
-
700
- // src/regions.ts
701
- var REGION_DEFINITIONS = [
702
- "us-east-1",
703
- "us-east-2",
704
- "us-west-1",
705
- "us-west-2",
706
- "ap-south-1",
707
- "ap-northeast-3",
708
- "ap-northeast-2",
709
- "ap-southeast-1",
710
- "ap-southeast-2",
711
- "ap-northeast-1",
712
- "ca-central-1",
713
- "eu-central-1",
714
- "eu-west-1",
715
- "eu-west-2",
716
- "eu-west-3",
717
- "eu-north-1",
718
- "sa-east-1"
719
- ];
720
- var AVAILABLE_REGIONS = [...REGION_DEFINITIONS];
721
-
722
- // src/detection/generate-config.ts
723
688
  var getInstallCommand = (pm) => {
724
689
  switch (pm) {
725
690
  case "bun":
@@ -773,11 +738,12 @@ var generateConfig = Effect6.fn("generateConfig")(function* (framework, packageM
773
738
  errors: [],
774
739
  ...defaults.normalizedConfig
775
740
  };
776
- if (defaults.assetsDir || defaults.assetPaths) {
741
+ if (defaults.assetsDir || defaults.assetPaths || defaults.assetPrefixes) {
777
742
  config.assets = {
778
743
  paths: defaults.assetPaths ? [...defaults.assetPaths] : [],
779
744
  prefixToStrip: defaults.assetsPrefixToStrip ?? (defaults.assetsDir ? defaults.assetsDir + "/" : ""),
780
745
  overrides: defaults.assetOverrides ? { ...defaults.assetOverrides } : void 0,
746
+ prefixes: defaults.assetPrefixes ? defaults.assetPrefixes.map((prefix) => ({ ...prefix })) : void 0,
781
747
  dynamicRoutes: true,
782
748
  populateCache: defaults.populateAssetCache ?? false
783
749
  };