Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synchronously copy files when watchAssets: false #2293

Merged
merged 1 commit into from Oct 23, 2023

Conversation

tkow
Copy link
Contributor

@tkow tkow commented Sep 17, 2023

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

What is the current behavior?

Even if watchAssets flag is false, the running nest start process can't exit from entry file because chokidar watches files and entry script runs as another child process when using webpack.
The reason why is internal runWebpack method doesn't call assetsManager.closeWatchers() when using nest start, but nest build does. At first, simply I tried to call assetsManager.closeWatchers() after onSuccess in compiler/webpack but, it can't listen to complete all entry file's processes. Additionally, current chokidar watcher can't detect whether all files matched by glob patterns is copied, so I think it would be better to process them synchronously when watchAssets: false is specified.

Issue Number: N/A

What is the new behavior?

Copy files process runs Synchronously.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

@tkow tkow marked this pull request as ready for review September 17, 2023 20:05
@kamilmysliwiec kamilmysliwiec mentioned this pull request Oct 23, 2023
3 tasks
@kamilmysliwiec kamilmysliwiec merged commit f20a3e3 into nestjs:master Oct 23, 2023
1 check passed
@tkow tkow deleted the fix/webpack-watch-assets branch October 30, 2023 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants