Skip to content

Commit ef3d0a9

Browse files
committed
Update to ESM to match Eleventy 3
1 parent 5a5e96f commit ef3d0a9

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

.eleventy.js renamed to eleventy.config.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
const Image = require("@11ty/eleventy-img");
2-
const syntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");
3-
const path = require("path");
1+
import Image from "@11ty/eleventy-img";
2+
import syntaxHighlight from "@11ty/eleventy-plugin-syntaxhighlight";
3+
import path from "path";
44

55
const shortcodes = {
66
image: async function(src, alt, sizes = "(max-width: 669px) 100vw, (min-width: 670) 670px", widths = [700, 1400, 4032]) {
@@ -50,7 +50,7 @@ const filters = {
5050
}
5151
}
5252

53-
module.exports = function (eleventyConfig) {
53+
export default function (eleventyConfig) {
5454
eleventyConfig.addPassthroughCopy("src/favicon-32x32.png");
5555
eleventyConfig.addPassthroughCopy("CNAME");
5656
eleventyConfig.addPlugin(syntaxHighlight);
@@ -62,7 +62,7 @@ module.exports = function (eleventyConfig) {
6262

6363
return {
6464
dir: {
65-
input: "src"
66-
}
67-
}
68-
};
65+
input: "src",
66+
},
67+
};
68+
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
"@11ty/eleventy": "^3.0.0",
99
"@11ty/eleventy-img": "^6.0.1",
1010
"@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0"
11-
}
11+
},
12+
"type": "module"
1213
}

0 commit comments

Comments
 (0)