@@ -17,8 +17,8 @@ In your project's [plugins file](https://on.cypress.io/guides/guides/plugins.htm
1717``` javascript
1818const webpack = require (' @cypress/webpack-preprocessor' )
1919
20- module .exports = (register , config ) => {
21- register ( ' on:spec: file:preprocessor' , webpack (config))
20+ module .exports = (on , config ) => {
21+ on ( ' file:preprocessor' , webpack (config))
2222}
2323```
2424
@@ -28,15 +28,15 @@ Pass in options as the second argument to `webpack`:
2828
2929``` javascript
3030const webpack = require (' @cypress/webpack-preprocessor' )
31- module .exports = (register , config ) => {
31+ module .exports = (on , config ) => {
3232 const options = {
3333 // send in the options from your webpack.config.js, so it works the same
3434 // as your app's code
3535 webpackOptions: require (' ../../webpack.config' ),
3636 watchOptions: {},
3737 }
3838
39- register ( ' on:spec: file:preprocessor' , webpack (config, options))
39+ on ( ' file:preprocessor' , webpack (config, options))
4040}
4141```
4242
@@ -83,11 +83,11 @@ If, for example, you want to update the options for the `babel-loader` to add th
8383``` javascript
8484const webpack = require (' @cypress/webpack-preprocessor' )
8585
86- module .exports = (register , config ) => {
86+ module .exports = (on , config ) => {
8787 const options = webpack .defaultOptions
8888 options .webpackOptions .module .rules [0 ].use .options .presets .push (' babel-preset-stage-3' )
8989
90- register ( ' on:spec: file:preprocessor' , webpack (config, options))
90+ on ( ' file:preprocessor' , webpack (config, options))
9191}
9292```
9393
0 commit comments