Skip to content

Commit

Permalink
Disable 11ty image processing for now (#6000)
Browse files Browse the repository at this point in the history
To test locally, checkout this branch (`gh pr checkout 6000`), run `pnpm
install`, then `./dash_site serve`.
  • Loading branch information
parlough authored Aug 2, 2024
1 parent 4fac41e commit 1bd6a55
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 447 deletions.
38 changes: 0 additions & 38 deletions eleventy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import yaml from 'js-yaml';

import * as path from 'node:path';
import * as sass from 'sass';
import {eleventyImageTransformPlugin} from '@11ty/eleventy-img';

// noinspection JSUnusedGlobalSymbols
/**
Expand Down Expand Up @@ -120,43 +119,6 @@ export default function (eleventyConfig) {

return content;
});

// Optimize all images, generate an avif, webp, and png version,
// and indicate they should be lazily loaded.
// Save in `_site/assets/img` and update links to there.
eleventyConfig.addPlugin(eleventyImageTransformPlugin, {
extensions: 'html',
formats: ['webp', 'png', 'svg'],
svgShortCircuit: true,
widths: ['auto'],
defaultAttributes: {
loading: 'lazy',
decoding: 'async',
},
urlPath: '/assets/img/',
outputDir: '_site/assets/img/',
sharpOptions: {
animated: true,
},
});
} else {
// To be more consistent with the production build,
// don't optimize images but still indicate they should be lazily loaded.
// Then save in `_site/assets/img` and update links to there.
eleventyConfig.addPlugin(eleventyImageTransformPlugin, {
extensions: 'html',
formats: ['auto'],
widths: ['auto'],
defaultAttributes: {
loading: 'lazy',
decoding: 'async',
},
urlPath: '/assets/img/',
outputDir: '_site/assets/img/',
sharpOptions: {
animated: true,
},
});
}

eleventyConfig.setQuietMode(true);
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
},
"devDependencies": {
"@11ty/eleventy": "3.0.0-beta.1",
"@11ty/eleventy-img": "5.0.0-beta.10",
"firebase-tools": "^13.15.0",
"hast-util-from-html": "^2.0.1",
"hast-util-select": "^6.0.2",
Expand Down
Loading

0 comments on commit 1bd6a55

Please sign in to comment.