fix: fix publish command for bun & pnpm (#137)

Co-authored-by: Jacob Nguyen <76754747+jacoobes@users.noreply.github.com>
This commit is contained in:
Duro
2024-06-03 12:34:58 -04:00
committed by GitHub
parent fe2e8ff0c0
commit d581142f08

View File

@@ -16,8 +16,10 @@ export async function publish(commandDir: string | undefined, args: Partial<Publ
commandDir && console.info('Publishing with override path: ', commandDir); commandDir && console.info('Publishing with override path: ', commandDir);
const dotenvLocation = new URL('../node_modules/dotenv/config.js', rootPath), const isBunOrPnpm = rootPath.pathname.includes('.bun') || rootPath.pathname.includes('.pnpm');
esmLoader = new URL('../node_modules/@esbuild-kit/esm-loader/dist/index.js', rootPath);
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 // We dynamically load the create-publish script in a child process so that we can pass the special
// loader flag to require typescript files // loader flag to require typescript files