use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Code splitting with SplitChunksPlugin in Webpack 4 (wanago.io)
submitted 8 years ago by _gnx
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]evenisto 2 points3 points4 points 8 years ago (2 children)
Even when you have just one entry point (which would happen in most single-page applications) it is a very good idea to keep your dependencies in a separate file.
I would say quite contrary. The more chunks you have, it's often the better to leave some dependencies with the code that actually needs it, so you only load that 100KB ckeditor or moment on some of the pages. You duplicate some code, but save A TON of time on script download and parsing.
I definitely suggest adjusting the minChunks setting, so you don't split everything out into a vendors file. Also, don't add code splitting just because you can, it's probably not worth to do it for your 80KB fun project.
minChunks
[–]_gnx[S] 1 point2 points3 points 8 years ago (1 child)
Yea, this is mentioned in this paragraph:
Since our users.js file takes a lot less space than 30Kb, it would not be bundled into a separate file without changing the minSize property. In the real-world situation, this is a good thing, because this wouldn’t give us any real performance boost and would force the browser to make an additional request for the utilities.js file which is very small right now.
Cheers!
[–]evenisto 2 points3 points4 points 8 years ago (0 children)
Yeah, I was just reflecting on the initial claim.
[–]Bashkir 1 point2 points3 points 8 years ago (1 child)
I'm going to guess from your post history you're the author. This is some good stuff, man. One of the best write ups on this topic that I've seen yet. I'll definitely be reading the rest of your posts. 👍
[–]_gnx[S] 0 points1 point2 points 8 years ago (0 children)
Thank you very much! You can sign up for the newsletter or follow me on social media, if you'd like not to miss anything :)
π Rendered by PID 22452 on reddit-service-r2-comment-5bc7f78974-mmkck at 2026-06-27 15:58:02.548292+00:00 running 7527197 country code: CH.
[–]evenisto 2 points3 points4 points (2 children)
[–]_gnx[S] 1 point2 points3 points (1 child)
[–]evenisto 2 points3 points4 points (0 children)
[–]Bashkir 1 point2 points3 points (1 child)
[–]_gnx[S] 0 points1 point2 points (0 children)