Skip to content

Commit 39e202e

Browse files
committed
fix: replace require("fs") with ESM import in publish script
1 parent ca72912 commit 39e202e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

scripts/release/publish-npm-packages.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { execFileSync } from "node:child_process";
2-
import { existsSync, writeFileSync, copyFileSync, chmodSync } from "node:fs";
2+
import { existsSync, readFileSync, writeFileSync, copyFileSync, chmodSync } from "node:fs";
33
import path from "node:path";
44
import { fileURLToPath } from "node:url";
55

@@ -179,7 +179,7 @@ function versionExists(pkgName, ver) {
179179

180180
function npmPublish(pkgDir) {
181181
const pkgJson = JSON.parse(
182-
require("fs").readFileSync(path.join(pkgDir, "package.json"), "utf8"),
182+
readFileSync(path.join(pkgDir, "package.json"), "utf8"),
183183
);
184184
const { name, version: ver } = pkgJson;
185185

0 commit comments

Comments
 (0)