feat: add support for watching copy source files#721
Open
schplitt wants to merge 3 commits intorolldown:mainfrom
Open
feat: add support for watching copy source files#721schplitt wants to merge 3 commits intorolldown:mainfrom
schplitt wants to merge 3 commits intorolldown:mainfrom
Conversation
✅ Deploy Preview for tsdown ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
commit: |
sxzz
requested changes
Jan 21, 2026
src/features/watch.ts
Outdated
Comment on lines
39
to
53
| const copyOptions: CopyOptions = | ||
| typeof config.copy === 'function' | ||
| ? await config.copy(config) | ||
| : config.copy | ||
|
|
||
| const copyFiles = ( | ||
| await Promise.all( | ||
| toArray(copyOptions).map((entry) => { | ||
| if (typeof entry === 'string') { | ||
| return resolveFilePatterns(entry, config.cwd) | ||
| } | ||
| return resolveFilePatterns(entry.from, config.cwd) | ||
| }), | ||
| ) | ||
| ).flat() |
Member
There was a problem hiding this comment.
Do not copy existing code, extract them instead.
src/utils/general.ts
Outdated
| * @param globOptions.expandDirectories - Expand directories (default: false) | ||
| * @returns Array of absolute file paths | ||
| */ | ||
| export async function resolveFilePatterns( |
Member
There was a problem hiding this comment.
Remove this function. See src/features/copy.ts
2f6ea1c to
dcaef07
Compare
Author
|
Thanks for the review Please let me know if you would rather have a utility file for |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds support for watching files specified in the
copyconfiguration option. Now triggers a rebuild whenever a copied asset is changed.Linked Issues
resolves #720
Additional context
I have manually tested this and confirmed that it works.
However, I have not found a good way to have an automated test for this.
What would be the best way forward regarding testing in this case?