File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change 11'use strict' ; 
22
33const  childProcess  =  require ( 'child_process' ) ; 
4- const  os  =  require ( 'os' ) ; 
5- const  path  =  require ( 'path' ) ; 
64
75/** 
86 * Absolute path to the sentry-cli binary (platform dependent). 
97 * @type  {string } 
108 */ 
11- // istanbul ignore next 
12- let  binaryPath  =  path . resolve ( 
13-   __dirname , 
14- 
15-   os . platform ( )  ===  'win32'  ? '..\\sentry-cli.exe'  : '../sentry-cli' 
9+ let  binaryPath  =  eval ( 
10+   "require('path').resolve(__dirname, require('os').platform() === 'win32' ? '..\\sentry-cli.exe' : '../sentry-cli')" 
1611) ; 
12+ 
13+ /** 
14+  * NOTE: `eval` usage is a workaround for @vercel/nft detecting the binary itself as the hard dependency 
15+  *       and effectively always including it in the bundle, which is not what we want. 
16+  * ref: https://github.com/getsentry/sentry-javascript/issues/3865 
17+  * ref: https://github.com/vercel/nft/issues/203 
18+  */ 
19+ 
1720/** 
1821 * Overrides the default binary path with a mock value, useful for testing. 
1922 * 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments