@@ -14,15 +14,16 @@ const defaultOptions = {
1414 {
1515 test : / \. j s x ? $ / ,
1616 exclude : [ / n o d e _ m o d u l e s / ] ,
17- use : [ {
18- loader : require . resolve ( 'babel-loader' ) ,
19- options : {
20- presets : [
21- 'babel-preset-env' ,
22- 'babel-preset-react' ,
23- ] . map ( require . resolve ) ,
17+ use : [
18+ {
19+ loader : require . resolve ( 'babel-loader' ) ,
20+ options : {
21+ presets : [ 'babel-preset-env' , 'babel-preset-react' ] . map (
22+ require . resolve
23+ ) ,
24+ } ,
2425 } ,
25- } ] ,
26+ ] ,
2627 } ,
2728 ] ,
2829 } ,
@@ -62,8 +63,16 @@ const preprocessor = (options = {}) => {
6263 }
6364
6465 // user can override the default options
65- let webpackOptions = Object . assign ( { } , defaultOptions . webpackOptions , options . webpackOptions )
66- let watchOptions = Object . assign ( { } , defaultOptions . watchOptions , options . watchOptions )
66+ let webpackOptions = Object . assign (
67+ { } ,
68+ defaultOptions . webpackOptions ,
69+ options . webpackOptions
70+ )
71+ let watchOptions = Object . assign (
72+ { } ,
73+ defaultOptions . watchOptions ,
74+ options . watchOptions
75+ )
6776
6877 // we're provided a default output path that lives alongside Cypress's
6978 // app data files so we don't have to worry about where to put the bundled
@@ -140,9 +149,9 @@ const preprocessor = (options = {}) => {
140149 log ( 'watching' )
141150 }
142151
143- const bundler = file . shouldWatch ?
144- compiler . watch ( watchOptions , handle ) :
145- compiler . run ( handle )
152+ const bundler = file . shouldWatch
153+ ? compiler . watch ( watchOptions , handle )
154+ : compiler . run ( handle )
146155
147156 // when the spec or project is closed, we need to clean up the cached
148157 // bundle promise and stop the watcher via `bundler.close()`
0 commit comments