Skip to content

Commit

Permalink
Opt-out of this feature to let the demo match up with the video
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleat committed Nov 1, 2023
1 parent ab365c4 commit 7c3a07b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions 11ty/filesize-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ module.exports = function(eleventyConfig, options) {
let originalFormat = Object.keys(originalMetadata).pop();

let before;
if(originalFormat === "svg") {
// use Brotli compressed SVG size.
before = originalMetadata[originalFormat][0].size;
} else {
// use original file directly.
let stats = fs.statSync(filePath);
before = stats.size;
}
// if(originalFormat === "svg") {
// // use Brotli compressed SVG size.
// before = originalMetadata[originalFormat][0].size;
// } else {
// use original file directly.
let stats = fs.statSync(filePath);
before = stats.size;
// }

let metadata = await imageStats(filePath, preferSvg, options.imageOptions);

Expand Down
2 changes: 1 addition & 1 deletion eleventy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const IMAGE_OPTIONS = {
formats: ["avif", "webp", "svg", "jpeg"],
outputDir: "./_site/optimized/",
urlPath: "/optimized/",
svgCompressionSize: "br",
// svgCompressionSize: "br",
};

module.exports = function(eleventyConfig) {
Expand Down

0 comments on commit 7c3a07b

Please sign in to comment.