Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit54cc291

Browse files
authored
Revert "fix: improve json import (anuraghazra#2190)" (anuraghazra#2191)
This reverts commit65424fa.
1 parent65424fa commit54cc291

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

‎src/cards/wakatime-card.js‎

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,9 @@ import { wakatimeCardLocales } from "../translations.js";
1818
* since vercel is using v16.14.0 which does not yet support json imports without the
1919
* --experimental-json-modules flag.
2020
*/
21-
import{readFileSync}from"fs";
22-
importpathfrom"path";
23-
import{fileURLToPath}from"url";
24-
const__filename=fileURLToPath(import.meta.url);
25-
const__dirname=path.dirname(__filename);
26-
constlanguageColors=JSON.parse(
27-
readFileSync(
28-
path.resolve(__dirname,"../common/languageColors.json"),
29-
"utf8",
30-
),
31-
);
21+
import{createRequire}from"module";
22+
constrequire=createRequire(import.meta.url);
23+
constlanguageColors=require("../common/languageColors.json");// now works
3224

3325
/**
3426
* Creates the no coding activity SVG node.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp