File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 11var url = require ( 'url' ) ;
22var SockJS = require ( "sockjs-client" ) ;
33var stripAnsi = require ( 'strip-ansi' ) ;
4- var scriptElements = document . getElementsByTagName ( "script" ) ;
5- var scriptHost = scriptElements [ scriptElements . length - 1 ] . getAttribute ( "src" ) . replace ( / \/ [ ^ \/ ] + $ / , "" ) ;
64
75// If this bundle is inlined, use the resource query to get the correct url.
86// Else, get the url from the <script> this file was called with.
9- var urlParts = url . parse ( typeof __resourceQuery === "string" && __resourceQuery ?
10- __resourceQuery . substr ( 1 ) :
11- ( scriptHost ? scriptHost : "/" ) , false , true
12- ) ;
7+ var urlParts ;
8+ if ( typeof __resourceQuery === "string" && __resourceQuery ) {
9+ urlParts = url . parse ( __resourceQuery . substr ( 1 ) ) ;
10+ } else {
11+ var scriptElements = document . getElementsByTagName ( "script" ) ;
12+ urlParts = url . parse ( scriptElements [ scriptElements . length - 1 ] . getAttribute ( "src" ) . replace ( / \/ [ ^ \/ ] + $ / , "" ) )
13+ }
1314
1415var sock = null ;
1516var hot = false ;
You can’t perform that action at this time.
0 commit comments