News for hackers. Stuff that matters.
Re:Small world with high risks: a study of security threats ... by rmilejczz on Monday September 30, 2019 @08:52AM (#21114782)
I recommend rollup for libraries and parcel for web apps.
Re:Small world with high risks: a study of security threats ... by lucideer on Monday September 30, 2019 @09:35AM (#21115162)
I'll 2nd the rollup recommendation for libraries, but unfortunately parcel has the same (or worse) problems as Webpack with it's proliferation of dependencies.

Rollup does have some issues with webapps since it's so heavily oriented toward JS-as-entrypoint, but tbh Webpack has the same issues; it just works around them by layering some extra complexity on top in the form of plugins (which you can actually do relatively easily in rollup too, though it's still not ideal in either situation).

Edit: Just measured those dependencies for comparison.

- rollup: 3 dependencies (all top-level, none have subdependencies. 2 are just typings which contain no executable code)

- webpack: 425 dependencies (23 top-level)

- parcel: 837 dependencies (57 top-level)

I haven't used parcel, so can't comment on its function. By the sounds of their website they're focused on speed, so if performance is your only concern they might be a good shout. If you're looking to reduce your security surface area, their approach to dependency management seems pretty irresponsible.

Re:Small world with high risks: a study of security threats ... by rmilejczz on Monday September 30, 2019 @11:46AM (#21116615)
Yeah I actually didn’t realize parcel had so many dependencies. I choose it over webpack not for speed but because it’s highly opinionated and requires essentially zero config.

So I guess I’ll change my suggestion and say just use rollup

Re:Small world with high risks: a study of security threats ... by jannes on Monday September 30, 2019 @09:31AM (#21115135)
Parcel has 57 dependencies... (not even counting transient dependencies)

That sort of defeats the purpose of switching from webpack.

And for libraries: Why do you even need a bundler? Can you not distribute the library as multiple files?

Re:Small world with high risks: a study of security threats ... by rmilejczz on Monday September 30, 2019 @12:02PM (#21116810)
Yeah I made some incorrect assumptions about the nature of parcel, foolish mistake on my part.

For your other question it depends on your library. If you’re only targeting ESM or CJS sure, if you need a UMD or want separate outputs for separate targets a bundler like rollup can help prevent a lot of pointless boilerplate.

Re:Small world with high risks: a study of security threats ... by sebazzz on Monday September 30, 2019 @10:34AM (#21115767)
Isn't parcel a front-end for webpack?