@@ -2,6 +2,7 @@ import fs from "node:fs";
22import path from "node:path" ;
33
44import logger from "../logger.js" ;
5+ import type { TagCacheMetaFile } from "../types/cache.js" ;
56import { isBinaryContentType } from "../utils/binary.js" ;
67import * as buildHelper from "./helper.js" ;
78
@@ -55,7 +56,7 @@ export function createStaticAssets(options: buildHelper.BuildOptions) {
5556 * Create the cache assets.
5657 *
5758 * @param options Build options.
58- * @returns Whether tag cache is used.
59+ * @returns Whether the tag cache is used, and the meta files collected .
5960 */
6061export function createCacheAssets ( options : buildHelper . BuildOptions ) {
6162 logger . info ( "Bundling cache assets..." ) ;
@@ -157,11 +158,7 @@ export function createCacheAssets(options: buildHelper.BuildOptions) {
157158 } ) ;
158159
159160 // We need to traverse the cache to find every .meta file
160- const metaFiles : {
161- tag : { S : string } ;
162- path : { S : string } ;
163- revalidatedAt : { N : string } ;
164- } [ ] = [ ] ;
161+ const metaFiles : TagCacheMetaFile [ ] = [ ] ;
165162
166163 // Copy fetch-cache to cache folder
167164 const fetchCachePath = path . join (
@@ -244,5 +241,5 @@ export function createCacheAssets(options: buildHelper.BuildOptions) {
244241 ( { relativePath } ) => ! relativePath . endsWith ( ".cache" ) ,
245242 ) ;
246243
247- return { useTagCache } ;
244+ return { useTagCache, metaFiles } ;
248245}
0 commit comments