Parcel: Is it possible to run build but watch mode at the same time with parcel cli?

Created on 17 Jul 2019  ·  6Comments  ·  Source: parcel-bundler/parcel

❔ Question

Is it possible to run parcel in build mode but watch as well? Target — to get in a dist all bundle files, while coding.

🔦 Context

Developing chrome extension and want to have always bundled dist folder. For now, I use a workaround with nodemon to restart the build script

Feature

Most helpful comment

Will this be possible in v2 by any chance? I'm looking for the same feature.

All 6 comments

parcel watch main.js is essentially parcel main.js without the dev server, so it doesn't do production output. Does this satisfy your needs?

https://github.com/parcel-bundler/parcel/blob/96119be782d9d551f73b77e06ab25067c7073344/packages/core/parcel-bundler/src/cli.js#L215-L224

@DeMoorJasper Is there a way to do parcel watch and production mode?

I need something opposite. Build with full production dist output and watch at the same time to always have fresh build in a dist folder ready to use.

(A production build can take considerably more time because of scope hoisting and minification, making the "watch" experience much less instant)

The only way this is currently possible is by using the node.js api afaik. But as @mischnic
mentioned this will be significantly slower than normal watchmode
Sent with GitHawk

Okay, I see. Yep, that's time-consuming. But what's left... Well, thanks anyway

Will this be possible in v2 by any chance? I'm looking for the same feature.

Was this page helpful?
0 / 5 - 0 ratings