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

Commit f23b602

Browse files
committed
chore: register -> on & on:spec:file:preprocessor -> file:preprocessor
1 parent 083ce6d commit f23b602

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ In your project's [plugins file](https://on.cypress.io/guides/guides/plugins.htm
1717
```javascript
1818
const 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
3030
const 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
8484
const 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

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const defaultOptions = {
3333
// export a function that returns another function, making it easy for users
3434
// to configure like so:
3535
//
36-
// register('on:spec:file:preprocessor', webpack(config, userOptions))
36+
// on('file:preprocessor', webpack(config, userOptions))
3737
//
3838
const preprocessor = (config, userOptions = {}) => {
3939
if (!config || typeof config.isTextTerminal !== 'boolean') {
@@ -44,7 +44,7 @@ const preprocessor = (config, userOptions = {}) => {
4444

4545

4646
// we return function that accepts the arguments provided by
47-
// the event 'on:spec:file:preprocessor'
47+
// the event 'file:preprocessor'
4848
//
4949
// this function will get called for the support file when a project is loaded
5050
// (if the support file is not disabled)

0 commit comments

Comments
 (0)