@@ -4,29 +4,28 @@ module.exports = {
4
4
'testFiles' : '**/*spec.js' ,
5
5
'componentFolder' : 'src' ,
6
6
'component' : {
7
- setupNodeEvents ( on , config ) {
7
+ devServer ( cypressConfig ) {
8
8
const { startDevServer } = require ( '@cypress/webpack-dev-server' )
9
9
const webpackConfig = require ( '@vue/cli-service/webpack.config' )
10
10
11
- on ( 'dev-server:start' , ( options ) => {
12
- // HtmlPwaPlugin is coupled to a hook in HtmlWebpackPlugin
13
- // that was deprecated after 3.x. We currently only support
14
- // HtmlWebpackPlugin 4.x and 5.x.
15
- // TODO: Figure out how to deal with 2 major versions old HtmlWebpackPlugin
16
- // which is still in widespread usage.
17
- const modifiedWebpackConfig = {
18
- ...webpackConfig ,
19
- plugins : ( webpackConfig . plugins || [ ] ) . filter ( ( x ) => {
20
- return x . constructor . name !== 'HtmlPwaPlugin'
21
- } ) ,
22
- }
11
+ // HtmlPwaPlugin is coupled to a hook in HtmlWebpackPlugin
12
+ // that was deprecated after 3.x. We currently only support
13
+ // HtmlWebpackPlugin 4.x and 5.x.
14
+ // TODO: Figure out how to deal with 2 major versions old HtmlWebpackPlugin
15
+ // which is still in widespread usage.
16
+ const modifiedWebpackConfig = {
17
+ ...webpackConfig ,
18
+ plugins : ( webpackConfig . plugins || [ ] ) . filter ( ( x ) => {
19
+ return x . constructor . name !== 'HtmlPwaPlugin'
20
+ } ) ,
21
+ }
23
22
24
- return startDevServer ( {
25
- options,
26
- webpackConfig : modifiedWebpackConfig ,
27
- } )
23
+ return startDevServer ( {
24
+ options : cypressConfig ,
25
+ webpackConfig : modifiedWebpackConfig ,
28
26
} )
29
-
27
+ } ,
28
+ setupNodeEvents ( on , config ) {
30
29
require ( '@cypress/code-coverage/task' ) ( on , config )
31
30
32
31
return config
0 commit comments