Use default json import (#2820)

This commit is contained in:
Alexandr Garbuzov 2023-06-15 10:27:28 +03:00 committed by GitHub
parent d5a4dbdc7e
commit 1474a3abbe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,17 +10,7 @@ import {
} from "../common/utils.js";
import { getStyles } from "../getStyles.js";
import { wakatimeCardLocales } from "../translations.js";
/** 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
import languageColors from "../common/languageColors.json";
/**
* Creates the no coding activity SVG node.