{"id":10442,"date":"2022-03-11T19:41:54","date_gmt":"2022-03-11T16:41:54","guid":{"rendered":"https:\/\/flatlogic.com\/blog\/?p=10442"},"modified":"2022-04-14T23:14:40","modified_gmt":"2022-04-14T20:14:40","slug":"what-is-webpack-flatlogic-glossary","status":"publish","type":"post","link":"https:\/\/flatlogic.com\/blog\/what-is-webpack-flatlogic-glossary\/","title":{"rendered":"What is Webpack?"},"content":{"rendered":"<p>Webpack is a <a href=\"https:\/\/webpack.js.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">module bundler<\/a> that lets you compile <a  data-ilj-link-preview=\"true\"  data-featured-image=\"https:\/\/flatlogic.com\/blog\/wp-content\/uploads\/2019\/09\/top-articles-copy-600x450.png\"  data-excerpt=\"Here is our list of JS articles of 2019. We collected 17 posts with tricks and tips in JavaScript and its frameworks.\" href=\"https:\/\/flatlogic.com\/blog\/17-articles-of-september-2019-to-learn-javascript\/\">JavaScript<\/a> modules (Files, Images, Fonts, JS, CSS, HTML, etc.). Webpack offers multiple functions, like merging modules, code minimization (or minimizing code by eliminating spaces, remarks, junk code, and code reduction), SASS or TypeScript compiling, integration with npm, and other features. It bundles and complements into something your developing application that the web browser can understand.<\/p><p>Webpack is also able to handle multiple other tasks:<\/p><ul class=\"wp-block-list\"><li>Assists in pulling your resources all together;<\/li><li>Monitors changes and re-runs tasks;<\/li><li>Can transpile using Babel&#8217;s next-generation JavaScript to an older JavaScript standard (ES5), allowing users to use the latest JavaScript features without worrying about whether or not their browser supports them;<\/li><li>Does CoffeeScript to JavaScript translation;<\/li><li>Can converse embedded images into data: URI;<\/li><li>can require() CSS files;<\/li><li>Works with Hot Module Replacement;<\/li><li>May Perform Tree Shaking;<\/li><li>Can split output file into several files so slow page load due to oversized JS-file is prevented.<\/li><\/ul><p>You can install Webpack globally or locally for each project. Using yarn: <\/p><pre class=\"wp-block-code\"><code>yarn global add webpack webpack-cli<\/code><\/pre><p>Or using <a  data-ilj-link-preview=\"true\"  data-featured-image=\"https:\/\/flatlogic.com\/blog\/wp-content\/uploads\/2022\/04\/Post-Light-3-1-1-600x600.png\"  data-excerpt=\"npm is a popular package manager for JavaScript programming frameworks and libraries maintained by npm, Inc.\" href=\"https:\/\/flatlogic.com\/blog\/what-is-npm\/\">npm<\/a>:<\/p><pre class=\"wp-block-code\"><code>npm i -g webpack webpack-cli<\/code><\/pre><h2 class=\"wp-block-heading\"><strong>How to start with Webpack<\/strong><\/h2><p>First of all, to start working with the webpack you need to know the following:<\/p><ul class=\"wp-block-list\"><li>Webpack is a Javascript library, meaning you need to install it with the npm package manager. If you don&#8217;t have a package.json file in the core of your application, enter the following command into your terminal: <strong>`npm init -y`. <\/strong>But if you do then: <strong>`npm install &#8211;save-dev webpack`.<\/strong><\/li><li>Webpack has one big file called &#8216;webpack.config.js&#8217; which will give you the ability to manage the bundling process. You need to create a webpack.config.js file in your root directory and paste the next basic code into it:<\/li><\/ul><figure class=\"wp-block-image\"><img decoding=\"async\" data-src=\"https:\/\/lh4.googleusercontent.com\/lPC0tIf7YBRu0BOC7nmiOAk_8nzEfgBNxKWS_MhlDCSXZl32ZILCQFqZDlRb0BbxZTuxDPX_FknM-kdPZfAOmQkd5C7P5og7XFkdvnk1wgAVkfFIQvno6WUUkx6T-bAtxDAo3THB\" alt=\"What is Webpack: code examples\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" \/><\/figure><p>You also need to define the following properties within the module.exports object. <a href=\"https:\/\/flatlogic.com\/generator\"><img decoding=\"async\" data-src=\"https:\/\/flatlogic.com\/blog\/wp-content\/uploads\/2025\/10\/Introducing-professional-vibe-coding.png\" alt=\"Professional Vibe Coding\" class=\"banner-img lazyload\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 2560px; --smush-placeholder-aspect-ratio: 2560\/640;\" data-srcset=\"https:\/\/flatlogic.com\/blog\/wp-content\/uploads\/2025\/10\/Introducing-professional-vibe-coding.png 2560w, https:\/\/flatlogic.com\/blog\/wp-content\/uploads\/2025\/10\/Introducing-professional-vibe-coding-600x150.png 600w, https:\/\/flatlogic.com\/blog\/wp-content\/uploads\/2025\/10\/Introducing-professional-vibe-coding-1024x256.png 1024w, https:\/\/flatlogic.com\/blog\/wp-content\/uploads\/2025\/10\/Introducing-professional-vibe-coding-768x192.png 768w, https:\/\/flatlogic.com\/blog\/wp-content\/uploads\/2025\/10\/Introducing-professional-vibe-coding-1536x384.png 1536w, https:\/\/flatlogic.com\/blog\/wp-content\/uploads\/2025\/10\/Introducing-professional-vibe-coding-2048x512.png 2048w\" data-sizes=\"auto\" data-original-sizes=\"(max-width: 2560px) 100vw, 2560px\"> <\/a><\/p><figure class=\"wp-block-table\"><table><tbody><tr><td>entry<\/td><td>here you need to enter the path to the .\/src\/index.js file.<\/td><\/tr><tr><td>output<\/td><td><strong>path: <\/strong>the folder in which the package is created is typically called .\/dist or public\/main.js. Here the public files of your application will be located.<strong>Filename: <\/strong>here will be contained all code.<\/td><\/tr><\/tbody><\/table><\/figure><ul class=\"wp-block-list\"><li>Next, you need to install loaders &#8211; npm special libs &#8211; and update the webpack.config.js to add some other files instead of JS.<\/li><li>Plugins are almost the same as loaders but under steroids. They can do what downloaders can&#8217;t. For example, on top of everything else, Webpack is built on a system of plugins that you use in your configuration file.<\/li><\/ul><h3 class=\"wp-block-heading\"><strong>Modes of Webpack<\/strong><\/h3><p>The modes ( introduced in version 4) configure the environment in which Webpack will work. The mode can be configured for development (dev) or production (prod). The default mode is production.<\/p><h4 class=\"wp-block-heading\"><strong>Dev mode:<\/strong><\/h4><ul class=\"wp-block-list\"><li>less optimized than production;<\/li><li>runs faster;<\/li><li>doesn&#8217;t strip comments;<\/li><li>provides deeper error messages and workarounds;<\/li><li>makes debugging much easier.<\/li><\/ul><h4 class=\"wp-block-heading\"><strong>Prod Mode<\/strong><\/h4><p>Prod mode is slower than dev mode since it needs to build a better-optimized bundle. Generated JavaScript file is smaller by size, as many things from development mode are missing in it.&nbsp;<\/p><p>To start the Webpack you can also with npm or yarn:<\/p><ul class=\"wp-block-list\"><li>npm run build<\/li><li>yarn run build or yarn build.<\/li><\/ul><h2 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h2><p>Webpack requires considerable training. But it is a tool well worth learning, considering the amount of time and effort it may save. Webpack doesn&#8217;t solve all issues. But it does fix the bundling issue.<\/p><h3 class=\"wp-block-heading\">Articles you may like:<\/h3><ul class=\"wp-block-list\"><li><a href=\"https:\/\/flatlogic.com\/blog\/what-is-git-why-use-it\/\">What is Git and Why Use It &#8211; Flatlogic Tech Glossary<\/a><\/li><li><a href=\"https:\/\/flatlogic.com\/blog\/how-to-create-a-vue-application\/\">How to Create a Vue Application [Learn the Ropes!]<\/a><\/li><li><a href=\"https:\/\/flatlogic.com\/blog\/what-is-php-explained-by-flatlogic\/\">What is PHP &#8211; Flatlogic Tech Glossary<\/a><\/li><li><a href=\"https:\/\/flatlogic.com\/blog\/what-is-hosting-and-domain-name\/\">What is Hosting and Domain Name &#8211; Flatlogic Blog<\/a><\/li><\/ul>","protected":false},"excerpt":{"rendered":"<p>Webpack is a module bundler for compiling JavaScript modules like fonts, images, CSS and HTML files, and more. This articles gives a detailed analysis of how to use Webpack and what factors to take into account.<\/p>\n","protected":false},"author":24,"featured_media":10496,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"flatlogic_tldr":"Webpack bundles JS and assets, compiles SASS\/TS, and integrates with npm.\nSupports Babel transpiling, HMR, tree shaking, and code splitting.\nConfigure via webpack.config.js with entry\/output; extend with loaders and plugins.\nModes since v4: dev for speed\/debugging; prod for optimized, smaller bundles.","flatlogic_facts":[{"text":"Webpack is a module bundler that compiles JS, CSS, HTML, images, and fonts into browser-ready assets.","source":"https:\/\/webpack.js.org\/"},{"text":"Modes were introduced in Webpack v4; the default mode is production.","source":""},{"text":"In development mode, builds run faster, keep comments, and provide deeper error messages.","source":""},{"text":"In production mode, builds are slower but output smaller, optimized JavaScript bundles.","source":""},{"text":"You can start builds with npm run build or yarn build.","source":""}],"footnotes":""},"categories":[28],"tags":[54,108,409,79],"class_list":["post-10442","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-guides","tag-javascript","tag-tech-glossary","tag-web-app-development","tag-web-development"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.2 (Yoast SEO v26.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>What is Webpack? - Flatlogic Blog<\/title>\n<meta name=\"description\" content=\"In this article we discuss not only what is webpack but also how to use it and what to look out for while you&#039;re at it.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/flatlogic.com\/blog\/what-is-webpack-flatlogic-glossary\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is Webpack?\" \/>\n<meta property=\"og:description\" content=\"In this article we discuss not only what is webpack but also how to use it and what to look out for while you&#039;re at it.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/flatlogic.com\/blog\/what-is-webpack-flatlogic-glossary\/\" \/>\n<meta property=\"og:site_name\" content=\"Flatlogic Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/flatlogic\" \/>\n<meta property=\"article:published_time\" content=\"2022-03-11T16:41:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-04-14T20:14:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/flatlogic.com\/blog\/wp-content\/uploads\/2022\/03\/webpack_img_720-compressed.png\" \/>\n\t<meta property=\"og:image:width\" content=\"720\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Alesia S.\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/flatlogic.com\/blog\/wp-content\/uploads\/2022\/03\/webpack_img_720-compressed.png\" \/>\n<meta name=\"twitter:creator\" content=\"@flatlogic\" \/>\n<meta name=\"twitter:site\" content=\"@flatlogic\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Alesia S.\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"What is Webpack? - Flatlogic Blog","description":"In this article we discuss not only what is webpack but also how to use it and what to look out for while you're at it.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/flatlogic.com\/blog\/what-is-webpack-flatlogic-glossary\/","og_locale":"en_US","og_type":"article","og_title":"What is Webpack?","og_description":"In this article we discuss not only what is webpack but also how to use it and what to look out for while you're at it.","og_url":"https:\/\/flatlogic.com\/blog\/what-is-webpack-flatlogic-glossary\/","og_site_name":"Flatlogic Blog","article_publisher":"https:\/\/www.facebook.com\/flatlogic","article_published_time":"2022-03-11T16:41:54+00:00","article_modified_time":"2022-04-14T20:14:40+00:00","og_image":[{"width":720,"height":720,"url":"https:\/\/flatlogic.com\/blog\/wp-content\/uploads\/2022\/03\/webpack_img_720-compressed.png","type":"image\/png"}],"author":"Alesia S.","twitter_card":"summary_large_image","twitter_image":"https:\/\/flatlogic.com\/blog\/wp-content\/uploads\/2022\/03\/webpack_img_720-compressed.png","twitter_creator":"@flatlogic","twitter_site":"@flatlogic","twitter_misc":{"Written by":"Alesia S.","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/flatlogic.com\/blog\/what-is-webpack-flatlogic-glossary\/#article","isPartOf":{"@id":"https:\/\/flatlogic.com\/blog\/what-is-webpack-flatlogic-glossary\/"},"author":{"name":"Alesia S.","@id":"https:\/\/flatlogic.com\/blog\/#\/schema\/person\/4ea8cd13c3b9919c455be1f34183a0c9"},"headline":"What is Webpack?","datePublished":"2022-03-11T16:41:54+00:00","dateModified":"2022-04-14T20:14:40+00:00","mainEntityOfPage":{"@id":"https:\/\/flatlogic.com\/blog\/what-is-webpack-flatlogic-glossary\/"},"wordCount":593,"commentCount":0,"publisher":{"@id":"https:\/\/flatlogic.com\/blog\/#organization"},"image":{"@id":"https:\/\/flatlogic.com\/blog\/what-is-webpack-flatlogic-glossary\/#primaryimage"},"thumbnailUrl":"https:\/\/flatlogic.com\/blog\/wp-content\/uploads\/2022\/03\/webpack_img_720-compressed.png","keywords":["Javascript","Tech Glossary","Web App Development","Web Development"],"articleSection":["Guides"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/flatlogic.com\/blog\/what-is-webpack-flatlogic-glossary\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/flatlogic.com\/blog\/what-is-webpack-flatlogic-glossary\/","url":"https:\/\/flatlogic.com\/blog\/what-is-webpack-flatlogic-glossary\/","name":"What is Webpack? - Flatlogic Blog","isPartOf":{"@id":"https:\/\/flatlogic.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/flatlogic.com\/blog\/what-is-webpack-flatlogic-glossary\/#primaryimage"},"image":{"@id":"https:\/\/flatlogic.com\/blog\/what-is-webpack-flatlogic-glossary\/#primaryimage"},"thumbnailUrl":"https:\/\/flatlogic.com\/blog\/wp-content\/uploads\/2022\/03\/webpack_img_720-compressed.png","datePublished":"2022-03-11T16:41:54+00:00","dateModified":"2022-04-14T20:14:40+00:00","description":"In this article we discuss not only what is webpack but also how to use it and what to look out for while you're at it.","breadcrumb":{"@id":"https:\/\/flatlogic.com\/blog\/what-is-webpack-flatlogic-glossary\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/flatlogic.com\/blog\/what-is-webpack-flatlogic-glossary\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/flatlogic.com\/blog\/what-is-webpack-flatlogic-glossary\/#primaryimage","url":"https:\/\/flatlogic.com\/blog\/wp-content\/uploads\/2022\/03\/webpack_img_720-compressed.png","contentUrl":"https:\/\/flatlogic.com\/blog\/wp-content\/uploads\/2022\/03\/webpack_img_720-compressed.png","width":720,"height":720,"caption":"What is Webpack - Flatlogic Tech Glossary"},{"@type":"BreadcrumbList","@id":"https:\/\/flatlogic.com\/blog\/what-is-webpack-flatlogic-glossary\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/flatlogic.com\/blog\/"},{"@type":"ListItem","position":2,"name":"What is Webpack?"}]},{"@type":"WebSite","@id":"https:\/\/flatlogic.com\/blog\/#website","url":"https:\/\/flatlogic.com\/blog\/","name":"Flatlogic Blog","description":"Vibe-coding, AI Agents, Professional Software Development Services, Case Studies and More","publisher":{"@id":"https:\/\/flatlogic.com\/blog\/#organization"},"alternateName":"Flatlogic Blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/flatlogic.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/flatlogic.com\/blog\/#organization","name":"Flatlogic","url":"https:\/\/flatlogic.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/flatlogic.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/flatlogic.com\/blog\/wp-content\/uploads\/2025\/10\/62ea6de0b3469aa3d6ebb528-1.png","contentUrl":"https:\/\/flatlogic.com\/blog\/wp-content\/uploads\/2025\/10\/62ea6de0b3469aa3d6ebb528-1.png","width":970,"height":257,"caption":"Flatlogic"},"image":{"@id":"https:\/\/flatlogic.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/flatlogic","https:\/\/x.com\/flatlogic","https:\/\/www.instagram.com\/flatlogiccom\/","https:\/\/www.linkedin.com\/company\/flatlogic\/"]},{"@type":"Person","@id":"https:\/\/flatlogic.com\/blog\/#\/schema\/person\/4ea8cd13c3b9919c455be1f34183a0c9","name":"Alesia S.","url":"https:\/\/flatlogic.com\/blog\/author\/alesya\/"}]}},"_links":{"self":[{"href":"https:\/\/flatlogic.com\/blog\/wp-json\/wp\/v2\/posts\/10442","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/flatlogic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/flatlogic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/flatlogic.com\/blog\/wp-json\/wp\/v2\/users\/24"}],"replies":[{"embeddable":true,"href":"https:\/\/flatlogic.com\/blog\/wp-json\/wp\/v2\/comments?post=10442"}],"version-history":[{"count":6,"href":"https:\/\/flatlogic.com\/blog\/wp-json\/wp\/v2\/posts\/10442\/revisions"}],"predecessor-version":[{"id":10556,"href":"https:\/\/flatlogic.com\/blog\/wp-json\/wp\/v2\/posts\/10442\/revisions\/10556"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/flatlogic.com\/blog\/wp-json\/wp\/v2\/media\/10496"}],"wp:attachment":[{"href":"https:\/\/flatlogic.com\/blog\/wp-json\/wp\/v2\/media?parent=10442"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/flatlogic.com\/blog\/wp-json\/wp\/v2\/categories?post=10442"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/flatlogic.com\/blog\/wp-json\/wp\/v2\/tags?post=10442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}