File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed
Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 1- export function getDirnameDynamically ( ) : string {
2- return new Function ( 'return __dirname' ) ( )
1+ export function getDirnameDynamically ( ) : string | undefined {
2+ return new Function (
3+ `try { return __dirname; } catch (e) { return undefined; }` ,
4+ ) ( )
35}
Original file line number Diff line number Diff line change 11{
22 "name" : " @codebuff/sdk" ,
33 "private" : false ,
4- "version" : " 0.3.9 " ,
4+ "version" : " 0.3.10 " ,
55 "description" : " Official SDK for Codebuff — AI coding agent & framework" ,
66 "license" : " Apache-2.0" ,
77 "type" : " module" ,
Original file line number Diff line number Diff line change @@ -60,7 +60,10 @@ export function getBundledRgPath(importMetaUrl?: string): string {
6060 // If not found via importMetaUrl, try CJS approach or other methods
6161 if ( ! vendorPath ) {
6262 // Try from __dirname if available (CJS context)
63- const dirname = new Function ( 'return __dirname' ) ( )
63+ const dirname = new Function (
64+ `try { return __dirname; } catch (e) { return undefined; }` ,
65+ ) ( )
66+
6467 if ( typeof dirname !== 'undefined' ) {
6568 const cjsPath = join (
6669 dirname ,
You can’t perform that action at this time.
0 commit comments