cypress-io / cypress-documentation

Cypress Documentation for the Cypress App, API, Cypress Cloud, UI Coverage and Cypress Accessibility.
https://docs.cypress.io
MIT License
955 stars 1.05k forks source link

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

Open silbinarywolf opened 5 years ago

silbinarywolf commented 5 years ago

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.

FFdhorkin commented 1 year ago

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.

MikeMcC399 commented 1 year ago

@FFdhorkin

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

Discord chat

seanwarmanshine commented 4 months ago

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?