Skip to content

Commit

Permalink
fix: polyfill __dirname in esm (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Feb 3, 2022
1 parent 878a7d1 commit 2652818
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/utils/copy-lib-files.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import fs from 'fs';
import { isAbsolute, resolve } from 'path';
import { dirname, isAbsolute, resolve } from 'path';
import { fileURLToPath } from 'url';
import { promisify } from 'util';

const copyFile = promisify(fs.copyFile);
const mkdir = promisify(fs.mkdir);
const readdir = promisify(fs.readdir);
const stat = promisify(fs.stat);

const __dirname = dirname(fileURLToPath(import.meta.url));

/**
* Absolute path to the Partytown lib directory within the
* `@builder.io/partytown` package.
Expand Down

1 comment on commit 2652818

@vercel
Copy link

@vercel vercel bot commented on 2652818 Feb 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.