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

Commit

Permalink
fix: add jsdoc for default options
Browse files Browse the repository at this point in the history
  • Loading branch information
bahmutov committed May 14, 2020
1 parent 9336dde commit 7eefb7c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,26 @@ type FilePreprocessor = (file: FileEvent) => Promise<FilePath>

type WebpackPreprocessorFn = (options: PreprocessorOptions) => FilePreprocessor

/**
* Cypress file preprocessor that can bundle specs
* using Webpack.
*/
interface WebpackPreprocessor extends WebpackPreprocessorFn {
/**
* Default options for Cypress Webpack preprocessor.
* You can modify these options then pass to the preprocessor.
* @example
```
const defaults = webpackPreprocessor.defaultOptions
module.exports = (on) => {
delete defaults.webpackOptions.module.rules[0].use[0].options.presets
on('file:preprocessor', webpackPreprocessor(defaults))
}
```
*
* @type {Omit<PreprocessorOptions, 'additionalEntries'>}
* @memberof WebpackPreprocessor
*/
defaultOptions: Omit<PreprocessorOptions, 'additionalEntries'>
}

Expand Down

0 comments on commit 7eefb7c

Please # to comment.