<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: CultureCodeLab</title>
    <description>The latest articles on DEV Community by CultureCodeLab (@culturecodelab).</description>
    <link>https://dev.to/culturecodelab</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F475499%2Fc1756769-91c8-4e3b-82f1-16dd92d4abc3.jpg</url>
      <title>DEV Community: CultureCodeLab</title>
      <link>https://dev.to/culturecodelab</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/culturecodelab"/>
    <language>en</language>
    <item>
      <title>Starting your journey into web development can feel overwhelming, especially when it comes to setting up the right tools. 

This guide walks beginner developers through the essential steps to install and configure basic web development tools.</title>
      <dc:creator>CultureCodeLab</dc:creator>
      <pubDate>Sat, 21 Mar 2026 14:33:38 +0000</pubDate>
      <link>https://dev.to/culturecodelab/starting-your-journey-into-web-development-can-feel-overwhelming-especially-when-it-comes-to-dib</link>
      <guid>https://dev.to/culturecodelab/starting-your-journey-into-web-development-can-feel-overwhelming-especially-when-it-comes-to-dib</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/culturecodelab/how-to-install-basic-web-development-tools-for-newbie-or-beginner-web-developer-2kb2" class="crayons-story__hidden-navigation-link"&gt;How to Install Basic Web Development Tools for Newbie or Beginner Web Developer&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/culturecodelab" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F475499%2Fc1756769-91c8-4e3b-82f1-16dd92d4abc3.jpg" alt="culturecodelab profile" class="crayons-avatar__image" width="400" height="400"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/culturecodelab" class="crayons-story__secondary fw-medium m:hidden"&gt;
              CultureCodeLab
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                CultureCodeLab
                
              
              &lt;div id="story-author-preview-content-3322950" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/culturecodelab" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F475499%2Fc1756769-91c8-4e3b-82f1-16dd92d4abc3.jpg" class="crayons-avatar__image" alt="" width="400" height="400"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;CultureCodeLab&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/culturecodelab/how-to-install-basic-web-development-tools-for-newbie-or-beginner-web-developer-2kb2" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Mar 21&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/culturecodelab/how-to-install-basic-web-development-tools-for-newbie-or-beginner-web-developer-2kb2" id="article-link-3322950"&gt;
          How to Install Basic Web Development Tools for Newbie or Beginner Web Developer
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/javascript"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;javascript&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/vscode"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;vscode&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/node"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;node&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/webdev"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;webdev&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
            &lt;a href="https://dev.to/culturecodelab/how-to-install-basic-web-development-tools-for-newbie-or-beginner-web-developer-2kb2#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              &lt;span class="hidden s:inline"&gt;Add Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            4 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>javascript</category>
      <category>vscode</category>
      <category>node</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How to Install Basic Web Development Tools Like Chrome, Git Bash, Visual Studio Code, Node JS for Beginner Web Developer</title>
      <dc:creator>CultureCodeLab</dc:creator>
      <pubDate>Sat, 21 Mar 2026 13:15:05 +0000</pubDate>
      <link>https://dev.to/culturecodelab/how-to-install-basic-web-development-tools-for-newbie-or-beginner-web-developer-2kb2</link>
      <guid>https://dev.to/culturecodelab/how-to-install-basic-web-development-tools-for-newbie-or-beginner-web-developer-2kb2</guid>
      <description>&lt;p&gt;Getting into web development is exciting, but before you write your first line of code, you must set up your laptop properly. A clean and well-configured development environment will save you hours of frustration and allow you to focus on what actually matters, learning how to build web applications.&lt;/p&gt;

&lt;p&gt;Most beginners think the hard part is learning HTML, CSS, or JavaScript. In reality, the first challenge is knowing which tools to install and how to configure them correctly.&lt;/p&gt;

&lt;p&gt;This guide walks you through the essential laptop setup every beginner web developer needs in 2026. Once you install these tools, your system will be ready for coding, building projects, and learning modern web development. 🚀&lt;/p&gt;

&lt;h4&gt;
  
  
  Table of Contents
&lt;/h4&gt;

&lt;p&gt;Installing Chrome Browser&lt;br&gt;
Git Bash Installation&lt;br&gt;
Visual Studio Code Installation&lt;br&gt;
NodeJS Installation&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing Chrome Browser
&lt;/h3&gt;

&lt;p&gt;A modern browser is a critical tool for every web developer. I strongly recommend installing Google Chrome because it provides excellent developer tools for debugging and testing websites.&lt;/p&gt;

&lt;p&gt;To install Chrome:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open your current browser and search for “Chrome download.”&lt;/li&gt;
&lt;li&gt;Click the first result from Google.&lt;/li&gt;
&lt;li&gt;You will be taken to the official download page.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You should see a blue download button clearly visible on the page.&lt;/p&gt;

&lt;p&gt;Click the Download button and the installer will begin downloading automatically.&lt;/p&gt;

&lt;p&gt;Once the download is complete:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open your Downloads folder&lt;/li&gt;
&lt;li&gt;Double-click the ChromeSetup.exe file&lt;/li&gt;
&lt;li&gt;Follow the installation prompts&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The installation process usually takes only a few minutes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Git Bash Installation
&lt;/h3&gt;

&lt;p&gt;Git Bash is a command-line tool that allows you to run Git commands and Linux-style terminal commands on Windows. Every developer should become comfortable using the terminal because it is faster and more powerful than clicking through folders.&lt;/p&gt;

&lt;p&gt;To install Git Bash:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Search for “Git Bash download” in your browser.&lt;/li&gt;
&lt;li&gt;Click the official git-scm.com result.&lt;/li&gt;
&lt;li&gt;Select the version for Windows.&lt;/li&gt;
&lt;li&gt;Download the Standalone Installer.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Your download will start automatically.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F10iuk4qowai9l7ynpf9b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F10iuk4qowai9l7ynpf9b.png" alt="Git bash instalation" width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
Once the download is complete:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open your Downloads folder&lt;/li&gt;
&lt;li&gt;Double-click the installer file (for example: Git-2.xx.x-64-bit.exe)&lt;/li&gt;
&lt;li&gt;Click Next through the setup interface&lt;/li&gt;
&lt;li&gt;Keep the default recommended settings&lt;/li&gt;
&lt;li&gt;Continue until the installation bar appears&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpint4i85w866v4x7qeqe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpint4i85w866v4x7qeqe.png" alt="Git bash instalation" width="800" height="619"&gt;&lt;/a&gt;&lt;br&gt;
Once finished, Git Bash will be installed on your computer.&lt;/p&gt;

&lt;h3&gt;
  
  
  Visual Studio Code Installation
&lt;/h3&gt;

&lt;p&gt;Every developer needs a good code editor. The most widely used editor today is Visual Studio Code, created by Microsoft.&lt;/p&gt;

&lt;p&gt;VS Code is lightweight, powerful, and packed with features that make writing code easier.&lt;/p&gt;

&lt;p&gt;To install VS Code:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Search for “Visual Studio Code download.”&lt;/li&gt;
&lt;li&gt;Click the official Microsoft link.&lt;/li&gt;
&lt;li&gt;Select your operating system (Windows, macOS, or Linux).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc5ryxkb2u46l2hf16dv4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc5ryxkb2u46l2hf16dv4.png" alt="Visual Studio Code Installation" width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
The installer will begin downloading automatically.&lt;/p&gt;

&lt;p&gt;After the download finishes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the Downloads folder&lt;/li&gt;
&lt;li&gt;Double-click the VS Code installer&lt;/li&gt;
&lt;li&gt;Accept the terms and conditions&lt;/li&gt;
&lt;li&gt;Click Next through the installation steps&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdfmula8v4avuqujk8lmo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdfmula8v4avuqujk8lmo.png" alt="Visual Studio Code Installation" width="714" height="592"&gt;&lt;/a&gt;&lt;br&gt;
Make sure you select the recommended options during installation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgvftjeblxsrjcu6261ic.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgvftjeblxsrjcu6261ic.png" alt="Visual Studio Code Installation" width="708" height="586"&gt;&lt;/a&gt;&lt;br&gt;
Once installation is complete, the VS Code icon will appear on your desktop, and you can start writing code immediately.&lt;/p&gt;

&lt;h3&gt;
  
  
  Node.js Installation
&lt;/h3&gt;

&lt;p&gt;Node.js is an open-source JavaScript runtime that allows developers to run JavaScript outside the browser. It is a fundamental tool for modern web development.&lt;/p&gt;

&lt;p&gt;To install Node.js:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Search for “Node.js download.”&lt;/li&gt;
&lt;li&gt;Click the official website.&lt;/li&gt;
&lt;li&gt;Scroll down to find the Windows Installer (.msi) option.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Avoid the Docker instructions on the page for now as i don't expect you to have docker installed. As a beginner, you only need the installer.&lt;/p&gt;

&lt;p&gt;Download the .msi installer file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa0sqnco93iu4vnbss25h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa0sqnco93iu4vnbss25h.png" alt="Node.js Installation" width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
Once the download finishes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the Downloads folder&lt;/li&gt;
&lt;li&gt;Double-click the Node installer&lt;/li&gt;
&lt;li&gt;Click Next&lt;/li&gt;
&lt;li&gt;Accept the terms and conditions&lt;/li&gt;
&lt;li&gt;Continue clicking Next until you see the Install button&lt;/li&gt;
&lt;li&gt;Click Install&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1bl7osx2w83jhhiw4sfs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1bl7osx2w83jhhiw4sfs.png" alt="Nodejs Installation" width="632" height="513"&gt;&lt;/a&gt;&lt;br&gt;
After installation is complete, Node.js will be ready to use.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Important:&lt;br&gt;
Node.js automatically installs npm (Node Package Manager), which developers use to install and manage JavaScript packages for their projects.&lt;/em&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Final Thoughts
&lt;/h4&gt;

&lt;p&gt;Once these tools are installed, your laptop is officially ready for web development.&lt;/p&gt;

&lt;p&gt;At this stage, your goal is not to install every tool available. The goal is to build a simple, stable development environment that allows you to focus on learning and building projects.&lt;/p&gt;

&lt;p&gt;As your experience grows, you will naturally discover new frameworks, tools, and workflows that improve your productivity.&lt;/p&gt;

&lt;p&gt;Web development in 2026 offers more opportunities than ever before, and your laptop is the starting point of that journey.&lt;/p&gt;

&lt;p&gt;Now that your environment is ready, there is only one thing left to do:&lt;/p&gt;

&lt;p&gt;Start coding. Practice consistently. Build real projects.&lt;/p&gt;

&lt;p&gt;Every skilled developer today started exactly where you are now—with a basic laptop setup and the decision to begin. 🚀&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>vscode</category>
      <category>node</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How to setup a vue project with webpack.</title>
      <dc:creator>CultureCodeLab</dc:creator>
      <pubDate>Mon, 28 Sep 2020 20:13:29 +0000</pubDate>
      <link>https://dev.to/culturecodelab/setup-vue-webpack-and-babel-boo</link>
      <guid>https://dev.to/culturecodelab/setup-vue-webpack-and-babel-boo</guid>
      <description>&lt;p&gt;This post gives a step by step guide to setting up vue.js using webpack. You’ll need to have node installed on your computer, you’ll also need a basic knowledge of how vue works, and of course a code editor.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Creating a folder and a package json file&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Installation of dependencies&lt;/em&gt;&lt;br&gt;
&lt;em&gt;File/Folder structure&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Configure webpack to use babel loader, and vue loader&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Write scripts to start your server&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Loaders, Plugins, and Code Splitting&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Final webpack configuration and Observation&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Creating a folder and a package json file &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;In your terminal, use the &lt;code&gt;mkdir&lt;/code&gt; command to create a project folder and use the &lt;code&gt;cd&lt;/code&gt; command to change directory into the folder created.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8yngflv45va709bmov9z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F8yngflv45va709bmov9z.png" alt="Alt Text" width="800" height="221"&gt;&lt;/a&gt;&lt;br&gt;
In the file you created, run the command &lt;code&gt;npm init –y&lt;/code&gt; to create a &lt;code&gt;package.json&lt;/code&gt; file&lt;/p&gt;
&lt;h2&gt;
  
  
  Installation of dependencies &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Now that we have a &lt;code&gt;package.json&lt;/code&gt; file to keep track of our dependencies, we can go ahead to install them.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dependencies: first we install vue, vue-router and core-js as dependencies. Run &lt;code&gt;npm install vue vue-router core-js --save&lt;/code&gt; this would install the three packages as dependencies.&lt;/li&gt;
&lt;li&gt;Dev-dependencies: Now we install webpack, webpack-cli, webpack-dev-server, babel-loader, &lt;a class="mentioned-user" href="https://dev.to/babel"&gt;@babel&lt;/a&gt;/core, &lt;a class="mentioned-user" href="https://dev.to/babel"&gt;@babel&lt;/a&gt;/preset-env, vue-loader, vue-template-compiler. Run &lt;code&gt;npm install webpack webpack-cli webpack-dev-server babel-loader @babel/core @babel/preset-env vue-loader vue-template-compiler -D&lt;/code&gt; this would install all these packages as dev-dependencies. Our package.json file should look like this after the installation process
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "name": "vue-webpack-setup",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" &amp;amp;&amp;amp; exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "core-js": "^3.6.5",
    "vue": "^2.6.12",
    "vue-router": "^3.4.3"
  },
  "devDependencies": {
    "@babel/core": "^7.11.6",
    "@babel/preset-env": "^7.11.5",
    "babel-loader": "^8.1.0",
    "vue-loader": "^15.9.3",
    "vue-template-compiler": "^2.6.12",
    "webpack": "^4.44.1",
    "webpack-cli": "^3.3.12",
    "webpack-dev-server": "^3.11.0"
  },
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  File/Folder structure &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Our folder structure would be similar to the default folder structure we get when using the vue cli to create a project. So lets create a public folder and an src folder in the root of our project. In the public folder, add a &lt;strong&gt;favicon.ico&lt;/strong&gt; file and create an &lt;strong&gt;index.html&lt;/strong&gt; file. In the &lt;strong&gt;index.html&lt;/strong&gt; file, add this boilerplate&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;meta charset="UTF-8" /&amp;gt;
    &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&amp;gt;
    &amp;lt;meta http-equiv="X-UA-Compatible" content="ie=edge" /&amp;gt;
    &amp;lt;title&amp;gt;Vue app&amp;lt;/title&amp;gt;
  &amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;
    &amp;lt;div id="app"&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;!-- built files will be auto injected --&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In our src folder lets create an &lt;strong&gt;App.vue&lt;/strong&gt; file and a &lt;strong&gt;main.js&lt;/strong&gt; file.&lt;br&gt;
N.B: &lt;strong&gt;App.vue&lt;/strong&gt; file starts with a capital letter.&lt;br&gt;
In our &lt;strong&gt;App.vue&lt;/strong&gt; file, add this code&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;template&amp;gt;
  &amp;lt;div id="app"&amp;gt;
    &amp;lt;div class="nav"&amp;gt;
      &amp;lt;router-link to="/"&amp;gt;Home&amp;lt;/router-link&amp;gt;|&amp;lt;router-link to="/about"
        &amp;gt;About&amp;lt;/router-link
      &amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;router-view /&amp;gt;
  &amp;lt;/div&amp;gt;
&amp;lt;/template&amp;gt;

&amp;lt;style lang="scss"&amp;gt;
// @import url("https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&amp;amp;display=swap");

// :root {
//   --font: Roboto, sans-serif;
//   --textColor: #374961;
//   --linkActiveColor: #41b783;
// }

// #app {
//   font-family: var(--font);
//   -webkit-font-smoothing: antialiased;
//   -moz-osx-font-smoothing: grayscale;
//   text-align: center;
//   color: var(--textColor);

//   .logo {
//     width: 20%;
//   }
// }

// .nav {
//   padding: 30px 0 100px 0;

//   a {
//     font-weight: 500;
//     color: var(--textColor);
//     margin: 0 5px;
//   }

//   a.router-link-exact-active {
//     color: var(--linkActiveColor);
//   }
// }
&amp;lt;/style&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the scss style is commented out because we don't have a loader to process &lt;strong&gt;.scss&lt;/strong&gt; files yet.&lt;/p&gt;

&lt;p&gt;In our &lt;strong&gt;main.js&lt;/strong&gt; file, add this code&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import Vue from "vue";
import App from "./App.vue";
import router from "./router";

new Vue({
  router,
  render: (h) =&amp;gt; h(App),
}).$mount("#app");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we create three folders in our src folder namely, assets, router, views. In the assets folder, lets add an image and call it &lt;strong&gt;logo.png&lt;/strong&gt;. In the router folder, create an &lt;strong&gt;index.js&lt;/strong&gt; file and add this code in the &lt;strong&gt;index.js&lt;/strong&gt; file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Home",
    component: Home,
  },
  {
    path: "/about",
    name: "About",
    component: () =&amp;gt;
      import(/* webpackChunkName: "about" */ "../views/About.vue"),
  },
];

const router = new VueRouter({
  mode: "history",
  routes,
});

export default router;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;notice how we imported the about component in the router, this kind of import tells webpack to lazyload the about component.&lt;/p&gt;

&lt;p&gt;In our views folder, lets create a file called &lt;strong&gt;Home.vue&lt;/strong&gt;.&lt;br&gt;
N.B: File names should start with capital letter.&lt;br&gt;
Now, let's add this code in our &lt;strong&gt;Home.vue&lt;/strong&gt; file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;template&amp;gt;
  &amp;lt;div id="home"&amp;gt;
    &amp;lt;!-- &amp;lt;img class="logo" src="../assets/logo.png" alt="logo" /&amp;gt; --&amp;gt;

    &amp;lt;h1&amp;gt;👋Hello world🌎&amp;lt;/h1&amp;gt;
  &amp;lt;/div&amp;gt;
&amp;lt;/template&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the image is commented out because we don't have a loader to process such file yet.&lt;/p&gt;

&lt;p&gt;then add this to our &lt;strong&gt;About.vue&lt;/strong&gt; file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;template&amp;gt;
  &amp;lt;div&amp;gt;
    &amp;lt;h1&amp;gt;This is the about page&amp;lt;/h1&amp;gt;
  &amp;lt;/div&amp;gt;
&amp;lt;/template&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If done correctly, we should have a folder structure that looks like this&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2862j3ti2nt7eswr1ve8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2862j3ti2nt7eswr1ve8.png" alt="Alt Text" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Configure webpack to use babel loader and vue loader &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Babel loader helps transpile ECMAScript 2015+ code into JavaScript that can be run by older JavaScript engines. While vue loader helps transform vue components into plain JavaScript module.&lt;/p&gt;

&lt;p&gt;To configure webpack to use these loaders, we need to create two files namely, &lt;strong&gt;babel.config.js&lt;/strong&gt;, and &lt;strong&gt;webpack.config.js&lt;/strong&gt;.&lt;br&gt;
In the &lt;strong&gt;babel.config.js&lt;/strong&gt; file lets add this code&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;module.exports = {
  presets: [
    [
      "@babel/preset-env",
      {
        useBuiltIns: "usage",
        corejs: 3,
      },
    ],
  ],
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a class="mentioned-user" href="https://dev.to/babel"&gt;@babel&lt;/a&gt;/preset-env helps to detect browsers we want to support so babel loader knows how to go about transpiling our JavaScript code. we would need to add a browserslist option in our &lt;strong&gt;package.json&lt;/strong&gt; file so babel knows what browsers we want to support. So in our &lt;strong&gt;package.json&lt;/strong&gt; file, let's add&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  "browserslist": [
    "&amp;gt; 1%",
    "last 2 versions",
    "not dead"
  ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ideally you would want to compile as little code as possible, so support only relevant browsers. The useBuiltIns and corejs options are for polyfill imports, you can read more about it &lt;a href="https://babeljs.io/blog/2019/03/19/7.4.0" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;br&gt;
In our &lt;strong&gt;webpack.config.js&lt;/strong&gt; file lets add this code&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const { VueLoaderPlugin } = require("vue-loader");
const path = require("path");

module.exports = {
  entry: {
    main: "./src/main.js",
  },
  output: {
    path: path.resolve(__dirname, "dist"),
  },
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        use: {
          loader: "babel-loader",
        },
      },
      {
        test: /\.vue$/,
        loader: "vue-loader",
      },
    ],
  },
  plugins: [
    new VueLoaderPlugin(),
  ],
  resolve: {
    alias: {
      vue$: "vue/dist/vue.runtime.esm.js",
    },
    extensions: ["*", ".js", ".vue", ".json"],
  },
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From the code above we import VueLoaderPlugin from vue-loader and the path module which we will be using to configure our entry and output point so webpack will know where to start compiling from and where to put our compiled code after compiling. You can read more about VueLoaderPlugin &lt;a href="https://vue-loader.vuejs.org/guide/#vue-cli" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In the code above we see a module option where we define some rules, the first rule tells webpack to use babel loader to transpile all files having a &lt;strong&gt;.js&lt;/strong&gt; extension excluding everything in the node_modules folder, while the second rule tells webpack to apply the vue loader to any file with a &lt;strong&gt;.vue&lt;/strong&gt; extension.&lt;/p&gt;

&lt;p&gt;The resolve option in the code above has an alias and extension key value pair, alias has a value which defines a vue alias and helps us import vue packages without using relative path, while extension has a value which tells webpack how to resolve imports and enables us import files without the extension, you can read more about it &lt;a href="https://webpack.js.org/configuration/resolve/#resolveextensions" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Write scripts to start your server &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;To see our setup work, we’ll need to write scripts in our &lt;strong&gt;package.json&lt;/strong&gt; file to run the webpack-dev-server. So go into the &lt;strong&gt;package.json&lt;/strong&gt; file and add these to the scripts object.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"build": "webpack --mode production",
"start": "webpack-dev-server --mode development"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we can go back to our terminal and run &lt;code&gt;npm run start&lt;/code&gt; to start up webpack development server, our project should compile successfully else you can go through the steps again or drop a comment, I’ll be glad to help you out.&lt;/p&gt;

&lt;p&gt;N.B: We won't be able to view our project in the browser yet because we haven't configured the htmlWebpackPlugin and webpack doesn't know where to insert our bundle files.&lt;/p&gt;

&lt;h2&gt;
  
  
  Loaders, Plugins, and Code Splitting &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Loaders and plugins are third-party extensions used in handling files with various extensions. Just like we used vue-loader to handling files with &lt;strong&gt;.vue&lt;/strong&gt; extension, we have loaders and plugins for &lt;strong&gt;.scss&lt;/strong&gt; files, &lt;strong&gt;.html&lt;/strong&gt; files, images, etc.&lt;/p&gt;

&lt;p&gt;Basically when you import/require files or modules, webpack tests the path against all loaders and passes the file to whichever loader passes the test. you can read more about loaders &lt;a href="https://webpack.docschina.org/loaders/" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this post, we will make use of file-loader, sass-loader, css-loader, style-loader, CleanWebpackPlugin, MiniCssExtractPlugin, htmlWebpackPlugin, autoprefixer. To install these loaders and plugin, we run &lt;code&gt;npm install file-loader sass sass-loader css-loader style-loader postcss postcss-loader autoprefixer clean-webpack-plugin html-webpack-plugin mini-css-extract-plugin -D&lt;/code&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;file-loader: The file-loader is used to process files like images, videos, fonts. To use file-loader, insert this code into &lt;strong&gt;webpack.config.js&lt;/strong&gt; file
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;      {
        test: /\.(eot|ttf|woff|woff2)(\?\S*)?$/,
        loader: "file-loader",
        options: {
          name: "[name][contenthash:8].[ext]",
        },
      },
      {
        test: /\.(png|jpe?g|gif|webm|mp4|svg)$/,
        loader: "file-loader",
        options: {
          outputPath: "assets",
          esModule: false,
        },
      },
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;working with &lt;strong&gt;.css&lt;/strong&gt; and &lt;strong&gt;.scss&lt;/strong&gt; files: For webpack to correctly process &lt;strong&gt;.css&lt;/strong&gt; and &lt;strong&gt;.scss&lt;/strong&gt; files, the order in which you arrange loaders is important. first we need to import MiniCssExtractPlugin and autoprefixer in our &lt;strong&gt;webpack.config.js&lt;/strong&gt; file like this &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;const MiniCssExtractPlugin = require("mini-css-extract-plugin");&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;const autoprefixer = require("autoprefixer");&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;then we add this code to the module of our &lt;strong&gt;webpack.config.js&lt;/strong&gt; file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;      {
        test: /\.s?css$/,
        use: [
          "style-loader",
          MiniCssExtractPlugin.loader,
          "css-loader",
          {
            loader: "postcss-loader",
            options: {
              plugins: () =&amp;gt; [autoprefixer()],
            },
          },
          "sass-loader",
        ],
      },
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;we also need to enable the MiniCssExtractPlugin in the plugin section of our &lt;strong&gt;webpack.config.js&lt;/strong&gt; file like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    new MiniCssExtractPlugin(),
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;sass-loader: The sass-loader is first used to process all &lt;strong&gt;.scss&lt;/strong&gt; files and compiles them to &lt;strong&gt;.css&lt;/strong&gt; files.&lt;/p&gt;

&lt;p&gt;postcss-loader: After sass-loader is done converting &lt;strong&gt;.scss&lt;/strong&gt; files to &lt;strong&gt;.css&lt;/strong&gt; files, postcss-loader and autoprefixer is then used to process the &lt;strong&gt;.css&lt;/strong&gt; files and add vendor prefix to the css postcss.&lt;/p&gt;

&lt;p&gt;css-loader: The css-loader then helps to return the css in &lt;strong&gt;.css&lt;/strong&gt; files that are imported or required in the project.&lt;/p&gt;

&lt;p&gt;style-loader: style-loader takes the css returned by css-loader and inserts it into the page.&lt;/p&gt;

&lt;p&gt;MiniCssExtractPlugin: The MiniCssExtractPlugin helps create a separate css file from &lt;strong&gt;.css&lt;/strong&gt; file imports, it is helpful for code splitting.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;htmlWebpackPlugin: this plugin helps to automatically generate an &lt;strong&gt;index.html&lt;/strong&gt; file and inserts our JavaScript bundle into the html body. To use the htmlWebpackPlugin, we first import it into our &lt;strong&gt;webpack.config.js&lt;/strong&gt; file like this &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;const htmlWebpackPlugin = require("html-webpack-plugin");&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;then enable the plugin in the plugin section by adding this code&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    new htmlWebpackPlugin({
      template: path.resolve(__dirname, "public", "index.html"),
      favicon: "./public/favicon.ico",
    }),
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;CleanWebpackPlugin: This plugin helps to erase outdated bundle files so it can be replace with the recent file while building. To use this plugin we first import it into our &lt;strong&gt;webpack.config.js&lt;/strong&gt; file like this &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;const { CleanWebpackPlugin } = require("clean-webpack-plugin");&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;then enable the plugin in the plugin section by adding this code&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;new CleanWebpackPlugin(),
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we can uncomment the image tag in the &lt;strong&gt;Home.vue&lt;/strong&gt; file and also the scss style in the &lt;strong&gt;App.vue&lt;/strong&gt; file, start our development server and view our project in the browser.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fzvibckqiee8km487494i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fzvibckqiee8km487494i.png" alt="Alt Text" width="800" height="325"&gt;&lt;/a&gt;&lt;br&gt;
The image above shows our bundle size when we build our project, presently our bundles does not have a random hash which helps with browser cache and we also need to split our code further by creating a vendor chunk and a runtime chunk.&lt;/p&gt;

&lt;p&gt;To hash our css bundles, we pass an object &lt;/p&gt;

&lt;p&gt;&lt;code&gt;{&lt;br&gt;
      filename: "[name].[contenthash:8].css",&lt;br&gt;
      chunkFilename: "[name].[contenthash:8].css",&lt;br&gt;
    }&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;as params to the MiniCssExtractPlugin.&lt;/p&gt;

&lt;p&gt;To hash our files we need to add&lt;/p&gt;

&lt;p&gt;&lt;code&gt;name: "[name][contenthash:8].[ext]",&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;to the options object of our file loader.&lt;/p&gt;

&lt;p&gt;To hash our bundles we need to add &lt;/p&gt;

&lt;p&gt;&lt;code&gt;filename: "[name].[contenthash:8].js",&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;chunkFilename: "[name].[contenthash:8].js",&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;in our webpack output section.&lt;/p&gt;

&lt;p&gt;If we build our project now, our bundles would have a random hash.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjijcsjsqhumiij3dyi8u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjijcsjsqhumiij3dyi8u.png" alt="Alt Text" width="800" height="353"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Code Splitting is an optimization technique used in reducing bundle size into smaller chunks, which helps to reduce the load time of our app. To configure webpack to split our bundle into chunks, we need to add an optimization section to our &lt;strong&gt;webpack.config.js&lt;/strong&gt; file.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  optimization: {
    moduleIds: "hashed",
    runtimeChunk: "single",
    splitChunks: {
      cacheGroups: {
        vendor: {
          test: /[\\/]node_modules[\\/]/,
          name: "vendors",
          priority: -10,
          chunks: "all",
        },
      },
    },
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The code above tells webpack to create a runtime chunk, vendor chunk from our node_modules folder, and hash them. Now we should see a runtime bundle and a vendor bundle when we build the project again.&lt;br&gt;
 &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmutnr4yq2pngte9lk18v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmutnr4yq2pngte9lk18v.png" alt="Alt Text" width="800" height="386"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Final webpack configuration and Observation &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Our final &lt;strong&gt;webpack.config.js&lt;/strong&gt; file should look like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const { VueLoaderPlugin } = require("vue-loader");
const htmlWebpackPlugin = require("html-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const autoprefixer = require("autoprefixer");
const path = require("path");

module.exports = {
  entry: {
    main: "./src/main.js",
  },
  output: {
    filename: "[name].[contenthash:8].js",
    path: path.resolve(__dirname, "dist"),
    chunkFilename: "[name].[contenthash:8].js",
  },
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        use: {
          loader: "babel-loader",
        },
      },
      {
        test: /\.vue$/,
        loader: "vue-loader",
      },
      {
        test: /\.(eot|ttf|woff|woff2)(\?\S*)?$/,
        loader: "file-loader",
        options: {
          name: "[name][contenthash:8].[ext]",
        },
      },
      {
        test: /\.(png|jpe?g|gif|webm|mp4|svg)$/,
        loader: "file-loader",
        options: {
          name: "[name][contenthash:8].[ext]",
          outputPath: "assets/img",
          esModule: false,
        },
      },
      {
        test: /\.s?css$/,
        use: [
          "style-loader",
          MiniCssExtractPlugin.loader,
          "css-loader",
          {
            loader: "postcss-loader",
            options: {
              plugins: () =&amp;gt; [autoprefixer()],
            },
          },
          "sass-loader",
        ],
      },
    ],
  },
  plugins: [
    new VueLoaderPlugin(),
    new CleanWebpackPlugin(),
    new MiniCssExtractPlugin({
      filename: "[name].[contenthash:8].css",
      chunkFilename: "[name].[contenthash:8].css",
    }),
    new htmlWebpackPlugin({
      template: path.resolve(__dirname, "public", "index.html"),
      favicon: "./public/favicon.ico",
    }),
  ],
  resolve: {
    alias: {
      vue$: "vue/dist/vue.runtime.esm.js",
    },
    extensions: ["*", ".js", ".vue", ".json"],
  },
  optimization: {
    moduleIds: "hashed",
    runtimeChunk: "single",
    splitChunks: {
      cacheGroups: {
        vendor: {
          test: /[\\/]node_modules[\\/]/,
          name: "vendors",
          priority: -10,
          chunks: "all",
        },
      },
    },
  },
  devServer: {
    historyApiFallback: true,
  },
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can checkout the repo &lt;a href="https://github.com/lavikara/basic-vue-boilerplate" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Observation: After I was done with the setup, I created a fresh vue3 project using the vue-cli and compared the bundle size of the vue3 project with the one I just set up and realised there wasn't a significant difference in the bundle size of both project. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This goes to show that there's really no point going through the stress of setting up your webpack. Except you absolutely need to change something, just use the vue-cli. &lt;/p&gt;

&lt;p&gt;I should also add that setting up webpack yourself is not a bad idea because in the end, no knowledge is lost.👌&lt;/p&gt;

</description>
      <category>vue</category>
      <category>webpack</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
