Skip to content
This repository was archived by the owner on Dec 12, 2020. It is now read-only.

Commit aaa7472

Browse files
committed
fix: simplify webpack options and document
1 parent cb09448 commit aaa7472

File tree

2 files changed

+7
-22
lines changed

2 files changed

+7
-22
lines changed

cypress/plugins/index.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
const webpack = require('@cypress/webpack-preprocessor')
1+
// https://github.com/cypress-io/cypress-webpack-preprocessor
2+
const webpackPreprocessor = require('@cypress/webpack-preprocessor')
3+
4+
// Cypress webpack options or just require from
5+
// an existing webpack.config.js
26
const webpackOptions = {
37
module: {
48
rules: [
@@ -11,12 +15,9 @@ const webpackOptions = {
1115
}
1216

1317
const options = {
14-
// send in the options from your webpack.config.js, so it works the same
15-
// as your app's code
16-
webpackOptions,
17-
watchOptions: {}
18+
webpackOptions
1819
}
1920

2021
module.exports = on => {
21-
on('file:preprocessor', webpack(options))
22+
on('file:preprocessor', webpackPreprocessor(options))
2223
}

src/index.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ const mountVue = (component, options = {}) => () => {
6767
const vueHtml = getPageHTML(options)
6868
document.write(vueHtml)
6969
document.close()
70-
console.log('wrote html')
71-
console.log(vueHtml)
7270
})
7371
cy
7472
.window()
@@ -81,17 +79,3 @@ const mountVue = (component, options = {}) => () => {
8179
}
8280

8381
module.exports = mountVue
84-
85-
// export const loadAndMountMyComponent = VueComponent => () => {
86-
// cy.visit('index.html')
87-
// cy
88-
// .window()
89-
// .its('Vue')
90-
// .then(Vue => {
91-
// deleteCachedConstructors(VueComponent)
92-
// // TODO go through ITS components and delete their constructors
93-
// // wonder if there is unified list
94-
// Cypress.vue = new Vue(VueComponent).$mount('#app')
95-
// copyStyles(VueComponent)
96-
// })
97-
// }

0 commit comments

Comments
 (0)