Skip to content

Parcel should (have option to )not watch the dist-dir #10229

@geertjanOSS

Description

@geertjanOSS

🙋 feature request

Option to skip dist-dir in watching.

🤔 Expected Behavior

Parcel should not watch the dist-dir even if included in the default or provided watch-dir, unless explicitly requested.

😯 Current Behavior

Parcel seems to hang or wait a long time during Packaging and Optimizing. When build folder is empty, Parcel is finished quicker.

💁 Possible Solution

Default parcel watch --watch-ignore [.git, .hg, <dist-dir>] with dist-dir auto-substituted.
Or explicit option --watch-skip-dist-dir or --watch-dist-dir, depending on default.

Bonus: Do not watch node_modules, although installs are not detected and require restart.

Possible add a .parcel.watch.ignore file to simplify the command line.

🔦 Context

Parcel Watch seems to hang or wait a long time during Packaging and Optimizing. Sometimes I need to kill parcel processes and restart. That is getting a bit of a hassle.

My build is way quicker and does hang way less when not watching build and node_modules
parcel watch --dist-dir build --watch-ignore [.git,build,node_modules]

Other observations:

Note that --watch-ignore is not documented on the website, but available via npx parcel watch --help.

Surprisingly sometimes it suddenly reports being built during the killing of the processes. Somehow some subprocess is blocking.

When build folder is empty, Parcel is finished quicker.
Parcel writes to build folder after Building and Bundling steps and during packaging and optimizing. The hang only occurs in packing and optimization.
This suggested some interaction with (existing) build folder contents.

One workaround is to clear the dist or build directory each round.

Consider not watching cache-dir and node_modules

💻 Examples

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions