File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ module.exports = (api) => {
14
14
} ,
15
15
] ,
16
16
] ,
17
+ plugins : [ '@babel/plugin-transform-object-assign' ] ,
17
18
env : {
18
19
test : {
19
20
plugins : [ '@babel/plugin-transform-runtime' ] ,
Original file line number Diff line number Diff line change @@ -25,8 +25,30 @@ const defaultOptions = {
25
25
useErrorOverlay : false ,
26
26
useProgress : false ,
27
27
} ;
28
- const parsedResourceQuery = parseURL ( __resourceQuery ) ;
29
- const options = Object . assign ( defaultOptions , parsedResourceQuery . query ) ;
28
+ const parsedResourceQuery = parseURL ( ) ;
29
+
30
+ let options = defaultOptions ;
31
+
32
+ // Handle Node.js legacy format and `new URL()`
33
+ if ( parsedResourceQuery . query ) {
34
+ options = Object . assign ( options , parsedResourceQuery . query ) ;
35
+ } else if ( parsedResourceQuery . searchParams ) {
36
+ const paramsToObject = ( entries ) => {
37
+ const result = { } ;
38
+
39
+ for ( const [ key , value ] of entries ) {
40
+ result [ key ] = value ;
41
+ }
42
+
43
+ return result ;
44
+ } ;
45
+
46
+ options = Object . assign (
47
+ options ,
48
+ paramsToObject ( parsedResourceQuery . searchParams . entries ( ) )
49
+ ) ;
50
+ }
51
+
30
52
const socketURL = createSocketURL ( parsedResourceQuery ) ;
31
53
32
54
function setAllLogLevel ( level ) {
You can’t perform that action at this time.
0 commit comments