Skip to content

Commit e566f29

Browse files
rickstaasetdebarr
authored andcommitted
Revert "Use default json import (anuraghazra#2820)" (anuraghazra#2829)
This reverts commit 1474a3a.
1 parent 5219cc6 commit e566f29

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/cards/wakatime-card.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,17 @@ import {
1010
} from "../common/utils.js";
1111
import { getStyles } from "../getStyles.js";
1212
import { wakatimeCardLocales } from "../translations.js";
13-
import languageColors from "../common/languageColors.json";
13+
14+
/** Import language colors.
15+
*
16+
* @description Here we use the workaround found in
17+
* https://stackoverflow.com/questions/66726365/how-should-i-import-json-in-node
18+
* since vercel is using v16.14.0 which does not yet support json imports without the
19+
* --experimental-json-modules flag.
20+
*/
21+
import { createRequire } from "module";
22+
const require = createRequire(import.meta.url);
23+
const languageColors = require("../common/languageColors.json"); // now works
1424

1525
/**
1626
* Creates the no coding activity SVG node.

0 commit comments

Comments
 (0)