Hacker News new | ask | show | jobs
by mumphster 2367 days ago
Parcel (https://parceljs.org/) fits this bill nicely and I use it for all my personal frontend development needs (node and browser targeted). You just add a script tag that points to a js/typescript/rust/(whatever else the author eventually adds) file and run parcel on said html file and you get hot reloading, decent error reporting, bundling, and asset loading via `import` without having to configure a single thing (other than npm installing sass and react and whatever other libraries you want to use))
3 comments

This is what I was going to suggest. I am working on moving towards react and some other better practices for our current jQuery/spaghetti code front end and I needed to be able to handle multiple entrypoints and types. I messed around with webpack and create react app and gulp and several other things for days before coming across parcel. It just works.

Want to build your react app? Just tell parcel where your index.js is and it will see your react and react dom imports and just build it. No config needed.

Want to do react in typescript? Just change your entrypoints to index.ts. Done. Even handled the yarn add commands for you.

This allowed me to easily have a few different react entrypoints as well as just a few random .ts files for use on pages that aren't built in react yet and then I just watch or build using a wildcard and it takes care of it all.

So far, I'm a big fan.

Yep, tried this recently after being out of JS land for a while, and Parcel just worked. So +1
It's also significantly faster the webpack, at least in my experience.