DEV Community

Discussion on: I maintain webpack, ask me anything!

Collapse
 
thelarkinn profile image
Sean Larkin

One of the most difficult part of webpack is learning how to configure it.

I would say this is one of the biggest misconceptions out there and I believe it boils down to fundamentals.

Most people fear the config because they don't realize:
It's just a JavaScript object that is module.exports'd.

somefile.js

module.exports = {

};

That's a webpack config ^ .

In addition to that, I think that really people not understanding the module ecosystem, why it exists, and why we write with modules. If you've never written a CommonJS, AMD, or ES Module before, you certainly are going to have a stronger uphill battle in understanding why webpack is awesome.

In terms of the configuration properties itself, we have bent over backwards creating webpack.js.org/configuration and keeping it strictly up to date to ensure that people understand what each property does or should do. IF NOT, please please please please please please please put in an issue to our docs GitHub. We consider even issues to be significant contributions!

Thoughts on HTTP2...

H2 makes bundling even more powerful. Instead of shipping 6-7 bundles/assets to a page, now you can ship 20-30 of them.

BUT THE KEY TO WEB PERF IS SHIPPING LESS CODE.

So these 20-30 JavaScript bundles shouldn't ever add up to anything more then 250kb UNCOMPRESSED. I challenge anyone to do that, and see how impactful it can be on your project and web load time.

Collapse
 
rhymes profile image
rhymes

Unfortunately lots of libraries push the code size way beyond 250kb. jQuery by itself is more than 250kb

Thread Thread
 
thelarkinn profile image
Sean Larkin

Exactly. And really that is why we see a lot of slow web today.

Collapse
 
ekanadily profile image
Esam A Kanadily

i agree with everything you said.

the point however that understanding all that AND figuring out the exact syntax needed in the config file AND sometimes also the order of things ( things that should go before other things) is very much a high bar for new developers.

very very high bar. only god knows how many developers quit web development all together in front of that fence.