News for hackers. Stuff that matters.
Re:Webpack 4 course: What is Webpack? by onion-soup on Monday July 16, 2018 @05:58AM (#17539974)
What is Webpack?

A several horrific hours of googling how to fix its configs so that it just works

Re:Webpack 4 course: What is Webpack? by gedy on Monday July 16, 2018 @06:13AM (#17540059)
I hear this trope here a lot, always seems to gloss over what webpack improved on, which is replacing bespoke build scripts for web projects. Also that it greatly reduced the ye olde tradition of coding to the least common denominator subset of features that runs on all browsers. Webpack was and is awesome for that.
Re:Webpack 4 course: What is Webpack? by lucisferre on Monday July 16, 2018 @09:48AM (#17541201)
> coding to the least common denominator subset of features that runs on all browsers

Did Webpack do that or did Babel?

Re:Webpack 4 course: What is Webpack? by sametmax on Monday July 16, 2018 @10:12AM (#17541349)
Babel. Webpack is just a glue. An over complicated glue.
Re:Webpack 4 course: What is Webpack? by dxhdr on Monday July 16, 2018 @10:35AM (#17541564)
> replacing bespoke build scripts for web projects

Does it, though? No project of moderate complexity will be able to reuse a Webpack config. Conversely, how large of a problem was this for simple sites?

Re:Webpack 4 course: What is Webpack? by noir_lord on Monday July 16, 2018 @03:31PM (#17544280)
I still use shell scripts for moving assets around and build sass, I use webpack for the TypeScript/dependency managment (via yarn).

I looked at doing it with webpack but frankly 2 lines of bash that'll work the same in a decade vs haha no wasn't a hard choice.

Re:Webpack 4 course: What is Webpack? by sametmax on Monday July 16, 2018 @09:11AM (#17540991)
The fact having a broken arm is better than having aids doesn't mean breaking an arm is nice.
Re:Webpack 4 course: What is Webpack? by lwansbrough on Monday July 16, 2018 @06:03AM (#17540002)
What is Webpack?

A question you’ll find yourself Googling every month as the “best approaches” change.

Re:Webpack 4 course: What is Webpack? by epicide on Monday July 16, 2018 @08:39AM (#17540803)
I have spent many hours on many versions of WebPack for code that has gone to production for a large company. I cannot give any more detail than that.

WebPack 1.x was very powerful but very difficult to understand and configure. There weren’t a lot of sane defaults and the docs did very little to adequately explain the core concepts. The problem(s) WebPack wolves are pretty complex and I haven’t seen anything else do quite what it does.

Starting with 2.x, the docs are great. They explain the concepts pretty well. They give you basic setups and examples throughout. 2+ also has a simplified base config: you only need a few items in your config to start getting some pretty big benefits.

While WebPack was not the first and certainly isn’t the only tool that provides what it does, it does provide a sort of one stop shop for a lot of what used to be separate tools. I don’t feel like it locks me in however.

Along with the ability to minify and other such “utility” functions (which you don’t have to do with WebPack), you get things like tree shaking. This can drastically shrink your final bundle.

As someone who does a lot of UI development, it’s also nice to be able to use ES2015 features like import without having to worry.

tl;dr I see complaints about WebPack being complicated and config heavy. It used (1.x) to be exactly that. It’s much better and the benefits from using it far beyond worth the (now little) upfront learning IMO.

Re:Webpack 4 course: What is Webpack? by sametmax on Monday July 16, 2018 @10:19AM (#17541406)
> The problem(s) WebPack wolves

This is such a great typo. I'm going to keep this sentence next time I need to explain webpack in my trainings.

Re:Webpack 4 course: What is Webpack? by epicide on Thursday July 19, 2018 @02:16PM (#17568966)
All I ask for is attribution ;)
Re:Webpack 4 course: What is Webpack? by Kagerjay on Monday July 16, 2018 @09:55AM (#17541248)
Something that should be avoided unless you really need it
Re:Webpack 4 course: What is Webpack? by jlebrech on Monday July 16, 2018 @08:08AM (#17540628)
it shouldn't be config based, should be a DSL or a library that's verbose enough to understand the workings of.
Re:Webpack 4 course: What is Webpack? by YuukiRey on Monday July 16, 2018 @08:37AM (#17540794)
Interesting that you should mention it. This talk https://www.youtube.com/watch?v=mVVNJKv9esE mentions some arguments why a DSL would not be a good approach for frontend/JS build tools. Namely that a DSL isn't adequate if the underlying best practices or requirements change a lot. That's why operating at a higher level of abstraction (function chaining/piping/composition) would make more sense.

Now... that doesn't really favor Webpack. And I still don't quite understand why that tool is so popular.

Re:Webpack 4 course: What is Webpack? by bpicolo on Monday July 16, 2018 @09:55AM (#17541246)
> That's why operating at a higher level of abstraction (function chaining/piping/composition) would make more sense.

That's just back to Gulp.