Skip to content

Commit

Permalink
Add Eleventy:Assets debug output for file system reads
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleat committed Dec 19, 2024
1 parent ab8cdcf commit b641ab2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/AssetCache.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,15 @@ class AssetCache {

async #getCachedContents(type) {
let contentPath = this.getCachedContentsPath(type);

debug(`Fetching from cache ${contentPath}`);

if (type === "json" || type === "parsed-xml") {
debugAssets("Reading from require('%o')", contentPath);
return require(contentPath);
}

debugAssets("Reading from: %o", contentPath);
return fs.readFileSync(contentPath, type !== "buffer" ? "utf8" : null);
}

Expand Down

0 comments on commit b641ab2

Please sign in to comment.