Skip to content

Commit

Permalink
fix: remove webpack-preprocessor from cypress config
Browse files Browse the repository at this point in the history
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 #2903
  • Loading branch information
cexbrayat committed Nov 6, 2018
1 parent 8dfb0da commit fbcb008
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ test('should work', async () => {
}
})

const pkg = JSON.parse(await project.read('package.json'))
expect(pkg.devDependencies).toHaveProperty('@cypress/webpack-preprocessor')

const config = JSON.parse(await project.read('cypress.json'))
config.video = false
await project.write('cypress.json', JSON.stringify(config))
Expand All @@ -40,9 +37,6 @@ test('should work with TS', async () => {
}
})

const pkg = JSON.parse(await project.read('package.json'))
expect(pkg.devDependencies).toHaveProperty('@cypress/webpack-preprocessor')

const config = JSON.parse(await project.read('cypress.json'))
config.video = false
await project.write('cypress.json', JSON.stringify(config))
Expand Down
3 changes: 0 additions & 3 deletions packages/@vue/cli-plugin-e2e-cypress/generator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ module.exports = api => {
})

api.extendPackage({
devDependencies: {
'@cypress/webpack-preprocessor': '^3.0.0'
},
scripts: {
'test:e2e': 'vue-cli-service test:e2e'
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
// https://docs.cypress.io/guides/guides/plugins-guide.html
/* eslint-disable import/no-extraneous-dependencies, global-require */
const webpack = require('@cypress/webpack-preprocessor')

// if you need a custom webpack configuration you can uncomment the following import
// and then use the `file:preprocessor` event
// as explained in the cypress docs
// https://docs.cypress.io/api/plugins/preprocessors-api.html#Examples

// /* eslint-disable import/no-extraneous-dependencies, global-require */
// const webpack = require('@cypress/webpack-preprocessor')

module.exports = (on, config) => {
on('file:preprocessor', webpack({
webpackOptions: require('@vue/cli-service/webpack.config'),
watchOptions: {}
}))
// on('file:preprocessor', webpack({
// webpackOptions: require('@vue/cli-service/webpack.config'),
// watchOptions: {}
// }))

return Object.assign({}, config, {
fixturesFolder: 'tests/e2e/fixtures',
Expand Down
4 changes: 0 additions & 4 deletions packages/@vue/cli-plugin-e2e-cypress/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,8 @@
"access": "public"
},
"dependencies": {
"@cypress/webpack-preprocessor": "^3.0.0",
"@vue/cli-shared-utils": "^3.1.1",
"cypress": "^3.1.0",
"eslint-plugin-cypress": "^2.0.1"
},
"peerDependencies": {
"@cypress/webpack-preprocessor": "^3.0.0"
}
}

0 comments on commit fbcb008

Please sign in to comment.