@@ -2,6 +2,7 @@ import fs from "node:fs";
2
2
import path from "node:path" ;
3
3
4
4
import logger from "../logger.js" ;
5
+ import type { TagCacheMetaFile } from "../types/cache.js" ;
5
6
import { isBinaryContentType } from "../utils/binary.js" ;
6
7
import * as buildHelper from "./helper.js" ;
7
8
@@ -55,7 +56,7 @@ export function createStaticAssets(options: buildHelper.BuildOptions) {
55
56
* Create the cache assets.
56
57
*
57
58
* @param options Build options.
58
- * @returns Whether tag cache is used.
59
+ * @returns Whether the tag cache is used, and the meta files collected .
59
60
*/
60
61
export function createCacheAssets ( options : buildHelper . BuildOptions ) {
61
62
logger . info ( "Bundling cache assets..." ) ;
@@ -157,11 +158,7 @@ export function createCacheAssets(options: buildHelper.BuildOptions) {
157
158
} ) ;
158
159
159
160
// 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 [ ] = [ ] ;
165
162
166
163
// Copy fetch-cache to cache folder
167
164
const fetchCachePath = path . join (
@@ -244,5 +241,5 @@ export function createCacheAssets(options: buildHelper.BuildOptions) {
244
241
( { relativePath } ) => ! relativePath . endsWith ( ".cache" ) ,
245
242
) ;
246
243
247
- return { useTagCache } ;
244
+ return { useTagCache, metaFiles } ;
248
245
}
0 commit comments