Skip to content

Commit

Permalink
Revert "Use default json import (anuraghazra#2820)" (anuraghazra#2829)
Browse files Browse the repository at this point in the history
This reverts commit 1474a3a.
  • Loading branch information
rickstaa authored and devantler committed Sep 24, 2023
1 parent 9952de7 commit aea8823
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/cards/wakatime-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,17 @@ import {
} from "../common/utils.js";
import { getStyles } from "../getStyles.js";
import { wakatimeCardLocales } from "../translations.js";
import languageColors from "../common/languageColors.json";

/** Import language colors.
*
* @description Here we use the workaround found in
* https://stackoverflow.com/questions/66726365/how-should-i-import-json-in-node
* since vercel is using v16.14.0 which does not yet support json imports without the
* --experimental-json-modules flag.
*/
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 aea8823

Please sign in to comment.