Skip to content

Commit 6fa6fb2

Browse files
committed
fix: remove webpack-preprocessor from cypress config
Removes the `@cypress/webpack-preprocessor` from the generated cypress configuration, as it leads to several issues regarding file watching, headless mode and TS support. Fixes vuejs#2903
1 parent 662b1d3 commit 6fa6fb2

File tree

4 files changed

+12
-16
lines changed

4 files changed

+12
-16
lines changed

packages/@vue/cli-plugin-e2e-cypress/__tests__/cypressPlugin.spec.js

-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ test('should work', async () => {
1414
}
1515
})
1616

17-
const pkg = JSON.parse(await project.read('package.json'))
18-
expect(pkg.devDependencies).toHaveProperty('@cypress/webpack-preprocessor')
19-
2017
const config = JSON.parse(await project.read('cypress.json'))
2118
config.video = false
2219
await project.write('cypress.json', JSON.stringify(config))

packages/@vue/cli-plugin-e2e-cypress/generator/index.js

-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ module.exports = api => {
55
})
66

77
api.extendPackage({
8-
devDependencies: {
9-
'@cypress/webpack-preprocessor': '^3.0.0'
10-
},
118
scripts: {
129
'test:e2e': 'vue-cli-service test:e2e'
1310
}

packages/@vue/cli-plugin-e2e-cypress/generator/template/tests/e2e/plugins/index.js

+12-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
// https://docs.cypress.io/guides/guides/plugins-guide.html
2-
/* eslint-disable import/no-extraneous-dependencies, global-require */
3-
const webpack = require('@cypress/webpack-preprocessor')
2+
3+
// if you need a custom webpack configuration you can uncomment the following import
4+
// and then use the `file:preprocessor` event
5+
// as explained in the cypress docs
6+
// https://docs.cypress.io/api/plugins/preprocessors-api.html#Examples
7+
8+
// /* eslint-disable import/no-extraneous-dependencies, global-require */
9+
// const webpack = require('@cypress/webpack-preprocessor')
410

511
module.exports = (on, config) => {
6-
on('file:preprocessor', webpack({
7-
webpackOptions: require('@vue/cli-service/webpack.config'),
8-
watchOptions: {}
9-
}))
12+
// on('file:preprocessor', webpack({
13+
// webpackOptions: require('@vue/cli-service/webpack.config'),
14+
// watchOptions: {}
15+
// }))
1016

1117
return Object.assign({}, config, {
1218
fixturesFolder: 'tests/e2e/fixtures',

packages/@vue/cli-plugin-e2e-cypress/package.json

-4
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,8 @@
2222
"access": "public"
2323
},
2424
"dependencies": {
25-
"@cypress/webpack-preprocessor": "^3.0.0",
2625
"@vue/cli-shared-utils": "^3.1.1",
2726
"cypress": "^3.1.0",
2827
"eslint-plugin-cypress": "^2.0.1"
29-
},
30-
"peerDependencies": {
31-
"@cypress/webpack-preprocessor": "^3.0.0"
3228
}
3329
}

0 commit comments

Comments
 (0)