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 1
1
var url = require ( 'url' ) ;
2
2
var SockJS = require ( "sockjs-client" ) ;
3
3
var stripAnsi = require ( 'strip-ansi' ) ;
4
- var scriptElements = document . getElementsByTagName ( "script" ) ;
5
- var scriptHost = scriptElements [ scriptElements . length - 1 ] . getAttribute ( "src" ) . replace ( / \/ [ ^ \/ ] + $ / , "" ) ;
6
4
7
5
// If this bundle is inlined, use the resource query to get the correct url.
8
6
// 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
+ }
13
14
14
15
var sock = null ;
15
16
var hot = false ;
You can’t perform that action at this time.
0 commit comments