6 ms·
> I won't pretend tsconfig/webpack or any other bundler out there is "fun" to work with For me, Parcel is fun to work with. Rollup is my favorite for more adva
by ewired 6y ago
> I won't pretend tsconfig/webpack or any other bundler out there is "fun" to work with
For me, Parcel is fun to work with. Rollup is my favorite for more advanced or customized pipelines, but Parcel has a silky smooth workflow for the typical bundling tasks in most projects. I've started using it for Node.js as well (since I want to avoid ts-node) but it seems best for frontend-only projects and components. Speaking as someone who has managed to avoid Webpack thus far despite its status as the "industry standard".
- sunsetSamurai 6y agodo you have any guide on how to setup,TS, linters etc with Parcel?
- ewired 6y agoFrom what I can tell, Parcel v1 does not have linting, but I rely on linting and typechecking in my editor anyway, so I didn't notice. It's actually pretty handy to bypass typechecking and write untyped JS to quickly check if something will work then add types to it gradually. VS Code yells at me until I fix it, so it doesn't go unfixed. https://parceljs.org/ https://parceljs.org/ is the homepage. Run the command (or put the command in an npm script) like `parcel whatever.ts` and it will output your bundle with all dependencies transpiled to JS and CSS. The simplicity does come at a cost; it's not as readily customizable as something like Rollup. I've been eagerly tracking v2 and it appears they are adding linting and much more into Parcel.
- kangabru 6y agoYeah I had the same issue and have been following the Typescript thread on GH for a while now [1]. But I agree, I actually like using untyped JS for development. What I do now is throw a "tsc --noEmit" call before tests/prod build to type everything before parcel runs. Works well enough. [1] https://github.com/parcel-bundler/parcel/issues/4022 https://github.com/parcel-bundler/parcel/issues/4022
- zamalek 6y agoThe whole point of Parcel is that you basically can't configure it. TS should just work. Rollup is basically a configurable Parcel.
- esperent 6y agoLook into esbuild as well. It falls somewhere in between Parcel and Rollup in terms of configuration options but it's way faster (around 10x compared to Rollup for my tests) than either.
- hardwaresofton 6y agolast time I tried to use Rollup, I found that it was very focused on NodeJS libs rather than frontend projects where Webpack (or other tools that bill themselves as "bundlers") is used more often. After a few "oh, rollup doesn't do that by default, guess I need this plugin"-situations, I switched back to Parcel. Has that changed? Was I just not using it right or didn't read the right rollup-for-the-web documentation?
- tazard 6y agoThat hasn't been my experience at all, in fact recent tools such as vite and snowpack are built on using rollup for frontend projects. You do need to install the plugins you want to use as they aren't all available out of the box, but generally I haven't had any troubles and basically just stick to the official plugins.
- tehbeard 6y agoRollup isn't focused on node, if it was commonJS support would be bundled into the code. It's got a small and focused core that aims for esm (I regard the other output formats supported as esm -> that format). You do need to plug stuff in rather than having a batteries included experience. But that is a strength imo where you want to worry only about what you need. I do recommend adapting an existing config when using it in a new project, or creating your own templates/"create-x-app" wrapper. I use it for my home projects, and several work ones. It's "lower level" than Babel or parcel but that means I can set it up to compile both a lean, modern esm build, and a legacy IE11 compatible polyfilled systemJS bundle much easier than I can in webpack with its proprietary bundle format or parcels zero config. I will admit that node resolve and commonJs rollup plugins are pretty much a required part to work within the npm ecosystem right now, so it is a bit more boilerplate-y than I'd like.