-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[Help Request] webpack --watch seems blocking --workspaces execution #3290
Comments
This option runs each matching script from each workspace sequentially, not concurrently. One script needs to exit before the next one is started and a One common way to do what you want is to use a package like concurrently. |
I had a look at concurrently, but i cannot figure out how to use it in my case. I got that concurrently can run multiple scripts in parallel, but they are all defined in the same package.json. |
So, you could list out all your workspaces and have concurrently run all of them. But, it sounds like what you really want is some system that automatically finds all your workspaces (which It shouldn't be too hard to roll your own script that finds all the workspaces. That being said, there should be a way to have Npm generate a list of all the workspaces in a project. Maybe just: |
Yes, you described exactly the functionality i'd like to use with npm workspaces. |
hi @marcog83 thanks for bringing it up to our attention. This is working as intended for the current implementation of workspaces in npm 7 and 8, although we are aware of the issue of running multiple jobs in parallel, it has been brought to our attention early on during our RFC process, ref: npm/rfcs#117 (review) Similar to what @cinderblock suggested, I would suggest
In the example above, the For the future I would recommend keeping an eye to our RFC repo to be aware of when that parallelization feature might come up natively in npm. Hope that helps! |
Is there an existing issue for this?
Current Behavior
I have a monorepo with the following structure
When I run
npm start
, it runs only the first package.It seems that --watch flag doesn't allow npm to run the other packages.
I removed the
--watch
flag and it worked fine, but it is not an option for me. I'd like to have webpack in watch mode.The same happens when I start an Express server.
webpack is watching the files…
Hash: 957d27c118caf599ee3c
Version: webpack 4.30.0
Time: 1187ms
Built at: 2021-05-22 13:55:16
Expected Behavior
I expected all the scripts run in
--watch
modeSteps To Reproduce
I have a monorepo with the following structure
When I run
npm start
, it runs only the first package.It seems that --watch flag doesn't allow npm to run the other packages.
I removed the
--watch
flag and it worked fine, but it is not an option for me. I'd like to have webpack in watch mode.The same happens when I start an Express server.
webpack is watching the files…
Hash: 957d27c118caf599ee3c
Version: webpack 4.30.0
Time: 1187ms
Built at: 2021-05-22 13:55:16
Environment
The text was updated successfully, but these errors were encountered: