File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,8 +14,8 @@ import highlightConfig from "./highlightConfig.js";
1414let JSDOM : any = null ;
1515
1616if ( typeof window === "undefined" ) {
17- const s = "jsdom" ; // somehow have to do this to avoid bundler issue
18- JSDOM = ( await import ( s ) ) . JSDOM ;
17+ const pkgs = typeof window === "undefined" ? [ "jsdom" ] : [ ] ;
18+ JSDOM = ( await import ( pkgs [ 0 ] ) ) . JSDOM ;
1919}
2020
2121function findNodeIdx ( nodes : CDPNode [ ] , nodeId : number ) : number {
Original file line number Diff line number Diff line change 11let CHROME_INSPECTOR_SYNC_EXTENSION_PATH : string | undefined ;
22
3+ const pkgs = typeof window === "undefined" ? [ "url" , "path" ] : [ ] ;
4+
35if ( typeof window === "undefined" ) {
4- const u = "url" ;
5- const { fileURLToPath } = await import ( u ) ;
6- const p = "path" ;
7- const path = await import ( p ) ;
6+ const { fileURLToPath } = await import ( pkgs [ 0 ] ) ;
7+ const path = await import ( pkgs [ 1 ] ) ;
88 const __filename = fileURLToPath ( import . meta. url ) ;
99 const __dirname = path . dirname ( __filename ) ;
1010
You can’t perform that action at this time.
0 commit comments