Skip to content

Commit

Permalink
Restore __dirname for cjs
Browse files Browse the repository at this point in the history
  • Loading branch information
ericanderson committed Jul 31, 2024
1 parent f789f73 commit 579b4a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export async function generatePackage(

const { findUp } = await import("find-up");
const nodeModulesPath = await findUp("node_modules", {
cwd: dirname(fileURLToPath(import.meta.url)),
cwd: __dirname,
type: "directory",
});

Expand Down Expand Up @@ -174,7 +174,7 @@ async function getDependencyVersion(dependency: string): Promise<string> {
}
const { findUp } = await import("find-up");
const result = await findUp("package.json", {
cwd: dirname(fileURLToPath(import.meta.url)),
cwd: __dirname,
});
const packageJson = await readFile(result!, {
encoding: "utf-8",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async function createRollupBuild(

const { findUp } = await import("find-up");
const nodeModulesPath = await findUp("node_modules", {
cwd: dirname(fileURLToPath(import.meta.url)),
cwd: __dirname,
type: "directory",
});

Expand Down

0 comments on commit 579b4a4

Please sign in to comment.