plaitse / webpack-toolset

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Webpack toolset

Module bundler to create static assets with Babel ES6/ES5 transpiler - Versions: Webpack 4 and Babel 7

What is Webpack?

Webpack is a JavaScript module bundler capable of transformating, bundling or packaging any resource or asset like JavaScript, HTML, CSS and images if the corresponding plugins are included. It allows a modular approach for the application development.

Famous features:

  • The bundler can be configured using a config file named webpack.config.js.
  • It can take modules with dependencies and generates static assets representing those modules.
  • Loaders allow to write custom tasks that we want to perform when bundling files together.
  • Provides a built in development server called Webpack Dev Server that can be used as a HTTP server for serving our files.
  • Provides the capability to use Hot module replacement by turning on the hot flag.

Createapp.dev simplifies the process of creating the config file: https://createapp.dev/webpack.

Prerequisites

  • Install Webpack globally via npm install -g webpack@latest
  • Install Webpack-cli globally via npm install -g webpack-cli@latest

Upgrade to Webpack 4 and Babel 7:

Installing

  • Install node modules via npm i

Running

At the root foler:

  • npm run dev for development mode - to compile stylesheets and JavaScript files, launch a server and reload the browser when changes are made
  • npm run prod for production mode - to only compile stylesheets and JavaScript files

Information

Babel

Loaders

Webpack


Other useful packages:

About


Languages

Language:JavaScript 45.4%Language:CSS 33.8%Language:HTML 20.8%