Skip to content

Commit

Permalink
ESM
Browse files Browse the repository at this point in the history
Signed-off-by: Sora Morimoto <sora@morimoto.io>
  • Loading branch information
smorimoto committed Nov 8, 2024
1 parent 5a4aca5 commit 09b0b77
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .eleventy.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = (eleventyConfig) => {
export default (eleventyConfig) => {
eleventyConfig.addPassthroughCopy("assets");
eleventyConfig.addPassthroughCopy("favicon*");
return {
Expand Down
4 changes: 2 additions & 2 deletions _data/octicons.js
Original file line number Diff line number Diff line change
@@ -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,
};
4 changes: 2 additions & 2 deletions _data/stages.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const EleventyFetch = require("@11ty/eleventy-fetch");
import EleventyFetch from "@11ty/eleventy-fetch";

function arrayEquals(a, b) {
return (
Expand All @@ -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"
Expand Down
6 changes: 5 additions & 1 deletion de/de.11tydata.js
Original file line number Diff line number Diff line change
@@ -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"),
Expand Down
6 changes: 5 additions & 1 deletion en/en.11tydata.js
Original file line number Diff line number Diff line change
@@ -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"),
Expand Down
6 changes: 5 additions & 1 deletion fr/fr.11tydata.js
Original file line number Diff line number Diff line change
@@ -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"),
Expand Down
6 changes: 5 additions & 1 deletion ja/ja.11tydata.js
Original file line number Diff line number Diff line change
@@ -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"),
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"type": "git",
"url": "https://github.com/tc39/tc39.github.io.git"
},
"type": "module",
"scripts": {
"prebuild": "npm run sass",
"build": "eleventy",
Expand Down
6 changes: 5 additions & 1 deletion ru/ru.11tydata.js
Original file line number Diff line number Diff line change
@@ -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"),
Expand Down
6 changes: 5 additions & 1 deletion uk/uk.11tydata.js
Original file line number Diff line number Diff line change
@@ -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"),
Expand Down
6 changes: 5 additions & 1 deletion zh-Hans/zh-Hans.11tydata.js
Original file line number Diff line number Diff line change
@@ -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"),
Expand Down

0 comments on commit 09b0b77

Please sign in to comment.