DEV Community

Cover image for My personal package bundler odyssey
Florian Klenk
Florian Klenk

Posted on

My personal package bundler odyssey

From parcel

For my project I used parcel bundler version 1.x from the beginning and was quite happy with it.
Zero configuration was great and I'm a supporter of smaller more innovative projects that do something different than the big players (e.g. trello > jira, pixelmator > photoshop).

To rollup

One day I've got an issue that a react file couldn't get loaded because of an svg that was imported. So as usual I want to dig into the manual to solve the problem. Thing was that the manual wasn't there anymore and replaced with parcel v2.
Well ok I thought when they ditch the old version and manual v2 must be stable enough. So I did the switch and discovered that at this time peerDependencies couldn't get resolved.

Being kind of a burned child with webpack spending to many hours in configuration I still wasn't ready for it. So I switched to rollup and had some nice rollup config.

original repo file

Not quite zero configuration but I rather read code than configuration options. The build worked. Problem was that it took ages to build :(

To webpack

Long story short I've ended up using webpack and it wasn't so worse how I imagined in the first place.
I used create-react-app to setup an empty project. Then I did eject (of course). Afterwards I've copied package.json typescript config and all other relevant config files into my project. It works flawlessly and I had zero configuration (by not looking at it :).

Checkout remotify to see how it works.

Fazit

I wouldn't got that far to recommend a solution that works for everything. There are use cases for all bundlers and I still love the zero configuration approach (who doesn't?).
But for my project webpack currently works best.

Top comments (6)

Collapse
 
ingosteinke profile image
Ingo Steinke

I'm surprised that you like Webpack, I still find it hard to understand its configuration syntax and having to use plugins for any seemingly simple requirement.
Have you tried Snowpack?
When I set up a new MERN application last year, I wanted to avoid using Webpack, and after struggling with Parcel 1 and Parcel 2, I found that Snowpack worked well in my case at least.

Collapse
 
flodev profile image
Florian Klenk

Hi, didn't know Snowpack? How is it performance wise?
After struggling with parcel and rollup I'd rather wanted to stick to something solid ... even though I hate to do that ;)
I still have the problem that webpack does not perform so well in a container on initial dev build. If I have the time I'll do the switch and test it. Maybe it's faster.

Collapse
 
thormeier profile image
Pascal Thormeier

Snowpack's blazing fast from what I can tell. I've written a small post on trying it and was amazed by it! Webpack's performance is lowered a lot, from what I know, by the sheer amount of regex it uses to do what it does. Snowpack's community is afaik growing pretty steadily, even though it doesn't get much visibility (at least in my filter bubble lol)

Collapse
 
pmkroeker profile image
Peter

Snowpack is very fast in dev, as it just re-compiles the files that were changed. Then you can configure it to leverage webpack for production.

Collapse
 
martinpham profile image
Martin Pham

sorry but you mean "package bundler"?

however, give esbuild a try!

Collapse
 
flodev profile image
Florian Klenk

Ok fixed. Thanks and thanks for the hint. Will check it out.