diff --git a/.eleventy.js b/.eleventy.js index eff68f2..ab8b0fb 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -1,4 +1,4 @@ -module.exports = (eleventyConfig) => { +export default (eleventyConfig) => { eleventyConfig.addPassthroughCopy("assets"); eleventyConfig.addPassthroughCopy("favicon*"); return { diff --git a/_data/octicons.js b/_data/octicons.js index 0b3dc89..afcbad4 100644 --- a/_data/octicons.js +++ b/_data/octicons.js @@ -1,7 +1,7 @@ -const octicons = require("@primer/octicons"); +import octicons from "@primer/octicons"; // @ts-check -module.exports = { +export default { commentDiscussion: octicons["comment-discussion"].heights[16].path, markGithub: octicons["mark-github"].heights[16].path, }; diff --git a/_data/stages.js b/_data/stages.js index f7ce460..c6a705e 100644 --- a/_data/stages.js +++ b/_data/stages.js @@ -1,4 +1,4 @@ -const EleventyFetch = require("@11ty/eleventy-fetch"); +import EleventyFetch from "@11ty/eleventy-fetch"; function arrayEquals(a, b) { return ( @@ -9,7 +9,7 @@ function arrayEquals(a, b) { ); } -module.exports = async () => { +export default async () => { const json = await EleventyFetch("https://tc39.es/dataset/proposals.json", { duration: "1h", // 1 day type: "json", // also supports "text" or "buffer" diff --git a/de/de.11tydata.js b/de/de.11tydata.js index ce7ca29..fb9f957 100644 --- a/de/de.11tydata.js +++ b/de/de.11tydata.js @@ -1,4 +1,8 @@ -module.exports = { +import { createRequire } from "node:module"; + +const require = createRequire(import.meta.url); + +export default { intro: require("./intro.json"), proposals: require("./proposals.json"), site: require("./site.json"), diff --git a/en/en.11tydata.js b/en/en.11tydata.js index f3f91a4..4dbf4c4 100644 --- a/en/en.11tydata.js +++ b/en/en.11tydata.js @@ -1,4 +1,8 @@ -module.exports = { +import { createRequire } from "node:module"; + +const require = createRequire(import.meta.url); + +export default { intro: require("./intro.json"), proposals: require("./proposals.json"), site: require("./site.json"), diff --git a/fr/fr.11tydata.js b/fr/fr.11tydata.js index 1000d77..467b826 100644 --- a/fr/fr.11tydata.js +++ b/fr/fr.11tydata.js @@ -1,4 +1,8 @@ -module.exports = { +import { createRequire } from "node:module"; + +const require = createRequire(import.meta.url); + +export default { intro: require("./intro.json"), proposals: require("./proposals.json"), site: require("./site.json"), diff --git a/ja/ja.11tydata.js b/ja/ja.11tydata.js index 961e008..f934cc0 100644 --- a/ja/ja.11tydata.js +++ b/ja/ja.11tydata.js @@ -1,4 +1,8 @@ -module.exports = { +import { createRequire } from "node:module"; + +const require = createRequire(import.meta.url); + +export default { intro: require("./intro.json"), proposals: require("./proposals.json"), site: require("./site.json"), diff --git a/package.json b/package.json index 6fc0988..da787ac 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "type": "git", "url": "https://github.com/tc39/tc39.github.io.git" }, + "type": "module", "scripts": { "prebuild": "npm run sass", "build": "eleventy", diff --git a/ru/ru.11tydata.js b/ru/ru.11tydata.js index 26eb809..bcb98dd 100644 --- a/ru/ru.11tydata.js +++ b/ru/ru.11tydata.js @@ -1,4 +1,8 @@ -module.exports = { +import { createRequire } from "node:module"; + +const require = createRequire(import.meta.url); + +export default { intro: require("./intro.json"), proposals: require("./proposals.json"), site: require("./site.json"), diff --git a/uk/uk.11tydata.js b/uk/uk.11tydata.js index 9c85add..8fd8edd 100644 --- a/uk/uk.11tydata.js +++ b/uk/uk.11tydata.js @@ -1,4 +1,8 @@ -module.exports = { +import { createRequire } from "node:module"; + +const require = createRequire(import.meta.url); + +export default { intro: require("./intro.json"), proposals: require("./proposals.json"), site: require("./site.json"), diff --git a/zh-Hans/zh-Hans.11tydata.js b/zh-Hans/zh-Hans.11tydata.js index 8f479c3..37a1be3 100644 --- a/zh-Hans/zh-Hans.11tydata.js +++ b/zh-Hans/zh-Hans.11tydata.js @@ -1,4 +1,8 @@ -module.exports = { +import { createRequire } from "node:module"; + +const require = createRequire(import.meta.url); + +export default { intro: require("./intro.json"), proposals: require("./proposals.json"), site: require("./site.json"),