cypress-documentation icon indicating copy to clipboard operation
cypress-documentation copied to clipboard

Add documentation to explain how to ignore certain files in the preprocessor API

Open silbinarywolf opened this issue 6 years ago • 3 comments

Related issue: https://github.com/cypress-io/cypress/issues/3098

@Bkucera said: Hi @silbinarywolf , you should be able to use the Preprocessor API to modify how cypress watches files and reloads Does this help?

I replied with: @Bkucera If documentation can be added here alongside watchForFileChanges here that explains how to ignore certain files via the preprocessor API, that'd be good. The issue was more that it wasn't immediately obvious how I can just force Cypress to ignore a certain file from being ~~changed~~ watched / triggering a Webpack build.

I was looking for something to exclude files being watched in the configuration section of the documentation.

EDIT: I edited my copy-pasted reply a bit for clarity.

silbinarywolf avatar Jan 18 '19 00:01 silbinarywolf

I'm trying to figure this out myself. In on('file:preprocessor', (file) => {/*stuff*/});, there's a file.shouldWatch property, but there doesn't seem to be a way to change that and hook into the default preprocessor without manually calling the preprocessor.

FFdhorkin avatar Jun 28 '23 07:06 FFdhorkin

@FFdhorkin

If you don't get an answer here, you could ask the Cypress technical community on Discord

Discord chat

MikeMcC399 avatar Jun 28 '23 07:06 MikeMcC399

I'm trying to figure this out myself. In on('file:preprocessor', (file) => {/*stuff*/});, there's a file.shouldWatch property, but there doesn't seem to be a way to change that and hook into the default preprocessor without manually calling the preprocessor.

@FFdhorkin did you ever work this out?

seanwarmanshine avatar Aug 01 '24 12:08 seanwarmanshine