Giter VIP home page Giter VIP logo

rachy / webpack-starter Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 14.04 MB

A basic webpack 4 boilerplate for beginners to start with any JS/ES6 based project. This project uses basic html with scss. It includes working background images in scss as well as file loading in html. Uses Dev Server and Sourcemaps for easy debugging.

License: MIT License

JavaScript 84.10% CSS 1.72% HTML 14.18%

webpack-starter's Introduction

Webpack 4 Boilerplate for beginners

A basic webpack 4 boilerplate for beginners to start with any JS/ES6 based project. This project uses basic html with scss. It includes working background images in scss as well as file loading in html. Uses Dev Server and Sourcemaps for easy debugging. Includes stylelinting and fixes for cleaner css. Uses Babel to convert ES6 to ES5.

Guide

This basic boilerplate is the final output of this comprehensive write up on Medium, plus several additions. I recommend to read this article to know the insight of how you can configure webpack from scratch. Webpack 3 quickstarter: Configure webpack from scratch

  1. Navigate to the appropriate parent folder of where your project will be located. This example uses a folder on the desktop called "class projects". NOTE: Start from your home directory "~".
$ cd path/my-projects
  1. Clone the webpack-starter into your parent folder with the following command:
$ git clone https://github.com/rachy/webpack-starter.git
  1. Change the name of webpack-starter to reflect the name of your project

  2. Change your directory to the project folder.

$ cd my-project
  1. Install dependencies
$ npm install
  1. Develop locally with webpack-dev-server
$ npm run dev

For Development version

$ npm run dev

Note: If your development browser window gets closed, you can find your project by navigating to: http://localhost:2000/

For Production version

$ npm run build

This is the final distribution version of your project located in the /dist folder

To restart your project after leaving it

  1. Navigate to your project folder in terminal

  2. Run Dev.

$ npm run dev

Note: it is safe to move from dev to build and build to dev. Just run [control] "c" to cancel dev processes if in the dev version.

Loaders and Plugins used in this boilerplate

Loaders

  • html-loader
  • sass-loader
  • css-loader
  • style-loader
  • file-loader
  • babel-loader

Plugins

  • clean-webpack-plugin
  • mini-css-extract-plugin
  • html-webpack-plugin
  • style-lint-plugin
  • optimize-css-assets-webpack-plugin
  • uglify-js-plugin

webpack-starter's People

Contributors

rachy avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

algelinplayer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.