Use import.meta.url instead of __dirname (#13721)
This commit is contained in:
parent
4ffbcc4bb2
commit
804a94f829
@ -3,9 +3,10 @@ import glob from "glob";
|
|||||||
import path from "path";
|
import path from "path";
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import { inspect } from "util";
|
import { inspect } from "util";
|
||||||
|
import { fileURLToPath } from "url";
|
||||||
|
|
||||||
// eslint-disable-next-line no-restricted-globals
|
const dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||||
const packages = path.resolve(__dirname, "..", "..");
|
const packages = path.resolve(dirname, "..", "..");
|
||||||
|
|
||||||
function readJson(file) {
|
function readJson(file) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user