unjs / unbuild

📦 An unified javascript build system
MIT License
2.19k stars 84 forks source link

Active watcher roadmap #281

Open pi0 opened 11 months ago

pi0 commented 11 months ago

Related: #265, https://github.com/unjs/unbuild/issues/20

Support unbuild --watch to run rollup in watch mode.

Roadmap:

jbaubree commented 10 months ago

@pi0 can't wait to get this feature 👍

joemckenney commented 9 months ago

@pi0 would you be open to a non-rollup implementation? If so, happy to contribute. We wrapped unbuild when building our own CLI build tool and implemented an active watcher w/ nodemon. You can see the implementation here. If interested, I'd be happy to implement a more generic/robust version of this in unbuild directly.

AbhiPrasad commented 8 months ago

Any appetite to this? Would you accept PRs for this change? Should we expose all of rollup watch config (delay, include, exclude)?

pi0 commented 8 months ago

We can start by supporting rollup watcher only. I think passing all watcher options should also be okay with some preconfigured defaults. @AbhiPrasad feel free to make a draft PR (preferably with as small changes as possible to allow moving forward quickly 🙏🏼 )

AbhiPrasad commented 8 months ago

Sounds like a plan - will take a look this weekend. Another q - what should happen when someone tried to do watch mode + stub mode at the same time?

pi0 commented 8 months ago

It would simply override stubs i guess (there are alternative ways to build dist: bundle|watch|stub)

danawoodman commented 6 months ago

dropping in to annoyingly +1 this 😇

tibineagu commented 6 months ago

@AbhiPrasad fingers crossed that you had a bit of time to work on this 🤞

jd-solanki commented 5 months ago

I started major version of my UI Lib Anu and decided to use unbuild now but due to missing support for this I'm rolling back to vite + library mode.

When this will be implemented hopefully I'll use unbuild 🤔

RSS1102 commented 5 months ago

🤔I also need this feature.May I ask when it can be pushed forward.


I hope it can support files in a key directory and listen to multiple directories, because when I want to develop plugins, plugins and playgrounds are under the same pwd().

joemckenney commented 4 months ago

@RSS1102 @jd-solanki take a peak at https://github.com/pkg-tools/pkg-tools/tree/main/packages/%40pkg-tools/build.

I took a swing at implementing this in the PR linked above but I've also implemented it in a cleaner manner in the library I'm developing that wraps unbuild.

Daydreamer-riri commented 3 months ago

Hi , any progress?

joemckenney commented 3 months ago

@Daydreamer-riri give https://www.npmjs.com/package/%40pkg-tools/build a try. It's a simple wrapper around unbuild with some nice additions.