Skip to content

Commit daeff67

Browse files
authored
Revert "fix: improve json import (#2190)"
This reverts commit 65424fa.
1 parent 65424fa commit daeff67

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/cards/wakatime-card.js

+3-11
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,9 @@ import { wakatimeCardLocales } from "../translations.js";
1818
* since vercel is using v16.14.0 which does not yet support json imports without the
1919
* --experimental-json-modules flag.
2020
*/
21-
import { readFileSync } from "fs";
22-
import path from "path";
23-
import { fileURLToPath } from "url";
24-
const __filename = fileURLToPath(import.meta.url);
25-
const __dirname = path.dirname(__filename);
26-
const languageColors = JSON.parse(
27-
readFileSync(
28-
path.resolve(__dirname, "../common/languageColors.json"),
29-
"utf8",
30-
),
31-
);
21+
import { createRequire } from "module";
22+
const require = createRequire(import.meta.url);
23+
const languageColors = require("../common/languageColors.json"); // now works
3224

3325
/**
3426
* Creates the no coding activity SVG node.

0 commit comments

Comments
 (0)