diff --git a/src/utils/copy-lib-files.ts b/src/utils/copy-lib-files.ts index 7a30fd2b..79ce7282 100644 --- a/src/utils/copy-lib-files.ts +++ b/src/utils/copy-lib-files.ts @@ -1,5 +1,6 @@ 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); @@ -7,6 +8,8 @@ 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.