Skip to content

Commit

Permalink
fix: fix publish command for bun & pnpm (#137)
Browse files Browse the repository at this point in the history
Co-authored-by: Jacob Nguyen <[email protected]>
  • Loading branch information
DuroCodes and jacoobes authored Jun 3, 2024
1 parent fe2e8ff commit d581142
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/commands/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ export async function publish(commandDir: string | undefined, args: Partial<Publ

commandDir && console.info('Publishing with override path: ', commandDir);

const dotenvLocation = new URL('../node_modules/dotenv/config.js', rootPath),
esmLoader = new URL('../node_modules/@esbuild-kit/esm-loader/dist/index.js', rootPath);
const isBunOrPnpm = rootPath.pathname.includes('.bun') || rootPath.pathname.includes('.pnpm');

const dotenvLocation = new URL(`${isBunOrPnpm ? '../../' : '../'}node_modules/dotenv/config.js`, rootPath),
esmLoader = new URL(`${isBunOrPnpm ? '../../' : '../'}node_modules/@esbuild-kit/esm-loader/dist/index.js`, rootPath);

// We dynamically load the create-publish script in a child process so that we can pass the special
// loader flag to require typescript files
Expand Down

0 comments on commit d581142

Please sign in to comment.