Skip to content

[Help Request] webpack --watch seems blocking --workspaces execution #3290

@marcog83

Description

@marcog83

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I have a monorepo with the following structure

root
 - package.json { "scripts": { "start": "npm run start:core --ws" }, "workspace":["./packages/*"] }
 - packages
   - action-bar
     - package.json { "scripts": { "start:core": "webpack --watch" } }
   - view-1
     - package.json { "scripts": { "start:core": "webpack --watch" } }
   - view-2
     - package.json { "scripts": { "start:core": "webpack --watch" } }
 

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.

@package/[email protected] start:core
webpack --watch

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 mode

Steps To Reproduce

I have a monorepo with the following structure

root
 - package.json { "scripts": { "start": "npm run start:core --ws" }, "workspace":["./packages/*"] }
 - packages
   - action-bar
     - package.json { "scripts": { "start:core": "webpack --watch" } }
   - view-1
     - package.json { "scripts": { "start:core": "webpack --watch" } }
   - view-2
     - package.json { "scripts": { "start:core": "webpack --watch" } }
 

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.

@package/[email protected] start:core
webpack --watch

webpack is watching the files…

Hash: 957d27c118caf599ee3c
Version: webpack 4.30.0
Time: 1187ms
Built at: 2021-05-22 13:55:16

Environment

  • OS: Window 10
  • Node: v12.18.3
  • npm: 7.14.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingRelease 7.xwork is associated with a specific npm 7 releaseWontfixthis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions