-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eleventy.js
38 lines (31 loc) · 978 Bytes
/
.eleventy.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const Image = require("@11ty/eleventy-img");
const CleanCSS = require("clean-css");
module.exports = function (eleventyConfig) {
eleventyConfig.addPlugin(Image.eleventyImageTransformPlugin, {
// which file extensions to process
extensions: "html",
// Add any other Image utility options here:
// optional, output image formats
formats: ["webp", "jpeg"],
// formats: ["auto"],
// optional, output image widths
// widths: ["auto"],
// optional, attributes assigned on <img> override these values.
defaultAttributes: {
loading: "lazy",
decoding: "async",
},
});
eleventyConfig.addFilter("cssmin", function (code) {
return new CleanCSS({}).minify(code).styles;
});
eleventyConfig.addPassthroughCopy("robots.txt");
eleventyConfig.addPassthroughCopy("_redirects");
eleventyConfig.addPassthroughCopy("favicon.ico");
return {
passthroughFileCopy: true,
dir: {
input: "src",
},
};
};