Skip to content

Commit ae25c87

Browse files
committed
fixup! address review feedback
1 parent b64f110 commit ae25c87

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

packages/cloudflare/src/cli/build/open-next/compile-skew-protection.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,21 @@ export async function compileSkewProtection(options: BuildOptions, config: OpenN
1717

1818
// Create a tree of assets located inside the base path
1919
const assetPath = path.join(options.outputDir, "assets", globalThis.__NEXT_BASE_PATH__ ?? "");
20-
const files = skewProtectionEnabled
20+
const assets = skewProtectionEnabled
2121
? await glob(`**/*`, {
2222
windowsPathsNoEscape: true,
2323
posix: true,
2424
nodir: true,
2525
absolute: false,
2626
cwd: assetPath,
27+
// All files located inside `_next/static` are static assets, no need to list them
28+
ignore: ["_next/static/**"],
2729
})
2830
: [];
29-
// All files located inside `_next/static` are static assets, no need to list them
30-
const assetTree = filesToTree(files.filter((path) => !path.startsWith("_next/static/")));
31+
32+
console.log(assets);
33+
34+
const assetTree = filesToTree(assets);
3135

3236
await build({
3337
entryPoints: [initPath],
@@ -45,7 +49,7 @@ export async function compileSkewProtection(options: BuildOptions, config: OpenN
4549
}
4650

4751
/**
48-
* Converts a list a file to tree of `FolderNode`
52+
* Converts a list of file paths into a tree of `FolderNode`
4953
*
5054
* @param paths The list of path
5155
* @returns The root node of the tree

packages/cloudflare/src/cli/templates/skew-protection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function maybeFetchAsset(request: Request, assets: Fetcher | undefined): Promise
9595
* A node represents a folder in the file tree
9696
*/
9797
export type FolderNode = {
98-
// List of file file in this folder
98+
// List of files in this folder
9999
f: string[];
100100
// Sub-folders.
101101
d: Record<string, FolderNode>;

0 commit comments

Comments
 (0)