Anybody here using Parcel or Rollup? Can somebody...
# general
a
Anybody here using Parcel or Rollup? Can somebody explain to me why I would use one of those instead of webpack? If my question doesn’t make sense, I looking to understand when should I use one of those. My goal is to build some internal UI libraries for my company, and I want to follow the best-practices and make it easy to use, etc.
t
please use vite
haha
a
Ok, yes, I saw that too… it’s new right?
t
Sort of, I've been using it for a few years
Basically because of ESM support (whether you're using it or not) there's now a new method of "bundling" during development that is 100x faster
vite is crazy fast, works really well, and uses rollup to bundle for production
r
I think vite uses rollup for production bundling? I find Webpack is way too cumbersome and complex.
a
Interesting.
t
yeah at this point I'd consider webpack legacy because there's no reason to start a new project on it
a
I hate webpack, for sure.
t
vite is even spawning a whole ecosystem, solidjs's SSR stuff is built on top of vite, there's vitest (which is what's in the new SST starters), etc
r
Nobody likes webpack, it just became the default when there weren’t other good options. Vite is great
It’s mad, vite was basically cooked up in a couple of days by Evan You, creator of VueJs and it absolutely exploded not long afterwards when people realised how simple and fast it was
t
yeah I was using snowpack prior to that which was the same concept
a
Ok, maybe Vite can work for me, I have to build some libraries, which are written in TS + React.
t
the creators of snowpack didn't use snowpack for their next project, they just used vite
Vite also has "library mode" @Adrián Mouly which might help if you're building something for something else to consume
a
Interesting.
Glad I asked this before starting anything 😂 .
t
yeah I sort of want to deprecate sst.ReactSite because that's built around create-react-app which no one should use anymore
a
So what we should use @thdxr?
Is there Vite + SST or something?
t
sst.ViteStaticSite
a
Interesting.
This also replaces
StaticSite
?
Because we build React app, without CRA.
Due we use other webpack version.. bla bla… we can’t use CRA.
So we use a lot
StaticSite
to deploy our frontends.
That can be replaced with
ViteStaticSite
too?
g
I like Parcel the best, and the reasons are actually explained quite well on their main website https://parceljs.org/
any time I've used Parcel the experience has been effortless
unfortunately most large projects grow large enough to need a webpack plugin 😄
(as in, something from a 3rd party vendor that only has a webpack variant)
a
@thdxr would Vite work well in the case where I have 1 single mono-repo with different React apps, and I want to build them like
lerna
does?
Or should I keep using
lerna
or
npm workspaces
?
t
Yes it'll work well, I suggest using npm workspaces + turborepo if you want to configure parallel builds
no need for lerna
a
What you mean with parallel builds?
t
actually nevermind this doesn't help you if using with sst
I still use turborepo to coordinate tasks I need run before sst deploy. Right now that's only typechecking
a
Ok I’m going to check it.
So turborepo works with vite too?
t
turborepo is just an alternative to lerna
a
Ok.
t
it's just for coordinating build tasks
a
I see, makes sense.
t
it's not necessary can add it in later, just use npm workspaces
a
Ok cool.
So might not need Vite yet.
Using
ReactStaticSite
might be enought.
t
you still should use vite!
local dev is much much better
a
Ok, yes, I want to try it.