-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Option to skip initial build when using watch flag #9730
Comments
We can't skip the initial build as it's needed to figure out dependencies that need to be watched. We could skip the initial emit. But I think the better way to solve this is to avoid emitting assets if it matches the file on disk. This won't require a flag and will speed up all builds when assets already exist. |
That's fair. The change in my PR only skips the initial emit behind a flag. Great idea. Any clues on where that belongs? I might spend some time trying to add it in. |
Alright, I have changed the option in my PR to |
Hey, any updates on this? |
This issue had no activity for at least three months. It's subject to automatic issue closing if there is no activity in the next 15 days. |
bump |
updates on this? very needed |
+1 |
1 similar comment
+1 |
Don't know how long this request will take. I wanted the feature so I had a look at the merge request. The changes themselves are straightforward. Though it's not recommended, you can apply the changes yourself. Just be aware that these changes will be overwritten during webpack updates https://github.com/webpack/webpack/pull/9735/files# (you do not need the changes to the test/ directory) |
Bump |
Feature request
Option to skip initial build when using watch flag.
What is the expected behavior?
When
--watch --skip-initial-build
, theskip-initial-build
flag tells webpack not to build initially, but instead build on subsequent detected changes.What is motivation or use case for adding/changing the behavior?
When working with mono-repos that have multiple packages where some packages depend on higher level packages, developers must build the top level dependencies first, then watch everything.
So imagine there are two packages a and b
b depends on a, so to successfully build b, a must already be built.
Developers would:
build a
watch a && watch b
b will automatically rebuild when it detects a change to a, which the initial build from watching a will produce.
This triggers a waterfall of builds when starting.
a, b, a, b
You can only imagine how bad it gets in projects with a few too many packages
If a developer could skip the initial building on a watch the flow would be
build a
build b
watch skip a && watch skip b
How should this be implemented in your opinion?
Are you willing to work on this yourself?
Added a pull request
#9735
The text was updated successfully, but these errors were encountered: