You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 1, 2020. It is now read-only.
thrownewError(`Cypress Webpack Preprocessor must be called with the Cypress config as its first argument. You passed: ${JSON.stringify(config,null,2)}`)
35
41
}
36
42
37
43
log('user options:',userOptions)
38
44
45
+
46
+
// we return function that accepts the arguments provided by
47
+
// the event 'on:spec:file:preprocessor'
48
+
//
49
+
// this function will get called for the support file when a project is loaded
50
+
// (if the support file is not disabled)
51
+
// it will also get calledfor a spec file when that spec is requested by
52
+
// the Cypress runner
53
+
//
54
+
// when running in the GUI, it will likely get called multiple times
55
+
// with the same filePath, as the user could re-run the tests, causing
56
+
// the supported file and spec file to be requested again
39
57
return(filePath,util)=>{
40
58
log('get',filePath)
41
59
60
+
// since this function can get called multiple times with the same
61
+
// filePath, we return the cached bundle promise if we already have one
62
+
// since we don't want or need to re-initiate webpack for it
42
63
if(bundles[filePath]){
43
64
log(`already have bundle for ${filePath}`)
44
65
returnbundles[filePath]
45
66
}
46
67
68
+
// if we're in a text terminal, this is a one-time run, probably in CI
69
+
// so we don't need to watch
47
70
constshouldWatch=!config.isTextTerminal
71
+
// util.getOutputPath returns a path alongside Cypress's other app data
72
+
// files so we don't have to worry about where to put the bundled
0 commit comments