Skip to content

Latest commit

 

History

History

webpack

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Learn Webpack

Setup

To setup your environment: install all dependencies

yarn

Build the application:

yarn build

Start the server:

yarn dev

Webpack

  • entrypoint: where webpack starts bundling from
  • output: where webpack should generated the bundled files
  • devServer: a development server configuration
    • contentBase: where the dev server will listen from
    • overlay: for every error, it will show an overlay about the error in the page
  • module rules: loaders to interpret different types of modules (js, css, html, png, jpg, gif)
  • babel: transform JavaScript code into older versions and allow to use future syntax and features
    • @babel/plugin-proposal-pipeline-operator: support for pipeline operator feature
    • babel-plugin-transform-async-to-promises: support for async-await feature
  • plugins: applies modifications to the generated bundle. e.g. minifiers, optimizations.
  • Webpack loaders vs plugins; what's the difference?
    • Loaders: works at the individual file level during or before the bundle is generated
    • Plugins: works at bundle level and usually work at the end of the bundle generation process