{"id":48,"date":"2025-02-06T23:00:27","date_gmt":"2025-02-06T23:00:27","guid":{"rendered":"https:\/\/blogs.oregonstate.edu\/tr3nn\/?p=48"},"modified":"2025-02-06T23:01:42","modified_gmt":"2025-02-06T23:01:42","slug":"unpacking-webpack","status":"publish","type":"post","link":"https:\/\/blogs.oregonstate.edu\/tr3nn\/2025\/02\/06\/unpacking-webpack\/","title":{"rendered":"Unpacking Webpack"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Learning is a treasure that will follow its owner everywhere.\u201d <\/p>\n\n\n\n<p>\u2013 Chinese Proverb<\/p>\n<\/blockquote>\n\n\n\n<p>&#8220;Learning&#8221; is something we do constantly. It begins right as we enter this world&#8230; and hopefully follows us as we leave it. Whether that means learning how to walk, learning people&#8217;s names, learning how to do taxes (always a fun one), or in my case&#8230; learning the in&#8217;s and out&#8217;s of the static module bundler for JS applications, <strong>webpack<\/strong>.<\/p>\n\n\n\n<p>This straight from webpack&#8217;s documentation:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>At its core,\u00a0<strong>webpack<\/strong>\u00a0is a\u00a0<em>static module bundler<\/em>\u00a0for modern JavaScript applications. When webpack processes your application, it internally builds a\u00a0dependency graph\u00a0from one or more\u00a0<em>entry points<\/em>\u00a0and then combines every module your project needs into one or more\u00a0<em>bundles<\/em>, which are static assets to serve your content from.<\/p>\n<\/blockquote>\n\n\n\n<p>Yeah, at first I didn&#8217;t really understand it either, but after getting my hands dirty in my team&#8217;s JS application, it all started to make sense. It essentially just ensures that only necessary code is delivered to your browser, which in return optimizes loading times. <\/p>\n\n\n\n<p>Now the ways in which webpack does this is using what&#8217;s called &#8220;entry&#8221; points which indicates which modules webpack should use to start building the dependency graph. This image used by a Tech Blogger named Skay illustrates it simply:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"685\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/8159\/files\/2025\/02\/Screenshot-2025-02-06-at-2.50.47\u202fPM-1024x685.png\" alt=\"\" class=\"wp-image-49\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/8159\/files\/2025\/02\/Screenshot-2025-02-06-at-2.50.47\u202fPM-1024x685.png 1024w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/8159\/files\/2025\/02\/Screenshot-2025-02-06-at-2.50.47\u202fPM-300x201.png 300w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/8159\/files\/2025\/02\/Screenshot-2025-02-06-at-2.50.47\u202fPM-768x513.png 768w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/8159\/files\/2025\/02\/Screenshot-2025-02-06-at-2.50.47\u202fPM-1200x802.png 1200w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/8159\/files\/2025\/02\/Screenshot-2025-02-06-at-2.50.47\u202fPM.png 1436w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Now with our project, there are lots of different assets, and files being utilized. Webpack at first made things harder because all the right files needed to be in the right place and linked correctly. All necessary files needed to be added as &#8220;entry&#8221; points and yeah you get the point.<\/p>\n\n\n\n<p>But as the beginning was difficult, just like learning anything new usually is, getting my hands dirty was the best thing to do. Getting into the code and seeing how it all connects has made the learning process quite enjoyable. I am excited to continue learning webpack.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learning is a treasure that will follow its owner everywhere.\u201d \u2013 Chinese Proverb &#8220;Learning&#8221; is something we do constantly. It begins right as we enter this world&#8230; and hopefully follows us as we leave it. Whether that means learning how to walk, learning people&#8217;s names, learning how to do taxes (always a fun one), or [&hellip;]<\/p>\n","protected":false},"author":14551,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-48","post","type-post","status-publish","format-standard","hentry","category-cs462"],"_links":{"self":[{"href":"https:\/\/blogs.oregonstate.edu\/tr3nn\/wp-json\/wp\/v2\/posts\/48","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.oregonstate.edu\/tr3nn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.oregonstate.edu\/tr3nn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/tr3nn\/wp-json\/wp\/v2\/users\/14551"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/tr3nn\/wp-json\/wp\/v2\/comments?post=48"}],"version-history":[{"count":1,"href":"https:\/\/blogs.oregonstate.edu\/tr3nn\/wp-json\/wp\/v2\/posts\/48\/revisions"}],"predecessor-version":[{"id":50,"href":"https:\/\/blogs.oregonstate.edu\/tr3nn\/wp-json\/wp\/v2\/posts\/48\/revisions\/50"}],"wp:attachment":[{"href":"https:\/\/blogs.oregonstate.edu\/tr3nn\/wp-json\/wp\/v2\/media?parent=48"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/tr3nn\/wp-json\/wp\/v2\/categories?post=48"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/tr3nn\/wp-json\/wp\/v2\/tags?post=48"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}