Skip to content

Commit

Permalink
Use import.meta.url instead of __dirname (#13721)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Sep 1, 2021
1 parent 4ffbcc4 commit 804a94f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/babel-types/test/fields.js
Expand Up @@ -3,9 +3,10 @@ import glob from "glob";
import path from "path";
import fs from "fs";
import { inspect } from "util";
import { fileURLToPath } from "url";

// eslint-disable-next-line no-restricted-globals
const packages = path.resolve(__dirname, "..", "..");
const dirname = path.dirname(fileURLToPath(import.meta.url));
const packages = path.resolve(dirname, "..", "..");

function readJson(file) {
return new Promise((resolve, reject) => {
Expand Down

0 comments on commit 804a94f

Please sign in to comment.