Skip to content

Commit

Permalink
Revert "fix: improve json import (anuraghazra#2190)" (anuraghazra#2191)
Browse files Browse the repository at this point in the history
This reverts commit 65424fa.
  • Loading branch information
rickstaa authored and devantler committed May 1, 2023
1 parent e9917d3 commit 0692877
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/cards/wakatime-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,9 @@ import { wakatimeCardLocales } from "../translations.js";
* since vercel is using v16.14.0 which does not yet support json imports without the
* --experimental-json-modules flag.
*/
import { readFileSync } from "fs";
import path from "path";
import { fileURLToPath } from "url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const languageColors = JSON.parse(
readFileSync(
path.resolve(__dirname, "../common/languageColors.json"),
"utf8",
),
);
import { createRequire } from "module";
const require = createRequire(import.meta.url);
const languageColors = require("../common/languageColors.json"); // now works

/**
* Creates the no coding activity SVG node.
Expand Down

0 comments on commit 0692877

Please sign in to comment.