Use default json import (#2820)
This commit is contained in:
1 parent
d5a4dbdc7e
commit
1474a3abbe
1 file changed
+1
-11
@@ -10,17 +10,7 @@ import {
|
|||||||
} from "../common/utils.js";
|
} from "../common/utils.js";
|
||||||
import { getStyles } from "../getStyles.js";
|
import { getStyles } from "../getStyles.js";
|
||||||
import { wakatimeCardLocales } from "../translations.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.
|
* Creates the no coding activity SVG node.
|
||||||
|
|||||||
Reference in new issue
Block a user