Giter Site home page Giter Site logo

wangchimei / boilerplate-webpack-scss-babel Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 244 KB

A boilerplate to start up your web development faster and easier. ๐Ÿš€ (Webpack 4 + HTML + SASS + Babel + ES6 + Livereload)

License: MIT License

JavaScript 60.11% CSS 26.47% HTML 13.43%
webpack webpack4 babel babel-webpack scss-loader html-loader file-loader webpack-dev-server

boilerplate-webpack-scss-babel's Introduction

Webpack 4 Boilerplate with SASS, Babel, HTML

npm version

A boilerplate to start up your web development faster and easier. ๐Ÿš€
(Webpack 4 + HTML + SASS + Babel + ES6 + Livereload)

Requirements

node.js needs to be installed.

Feature

  • Support Livereload
  • Support syntax ES2015+
  • Support browser cache busting on production mode
  • Minify HTML and CSS on production mode
  • Two settings for development mode and production mode

List of Packages and Modules

  • Webpack v4.42.0
  • Webpack Dev Server v3.10.3
  • Babel(Core) v7.8.7
  • Babel Loader v8.0.6
  • HTML Loader v0.5.5
  • CSS Loader v3.4.2
  • Sass Loader v8.0.2
  • Style Loader v1.1.3
  • File Loader v5.1.0
  • HTML Webpack Plugin v3.2.0
  • Mini CSS Extract Plugin v0.9.0
  • Clean Webpack Plugin v3.0.0

File Structures

.
โ”œโ”€โ”€ dist                     # Generated files
โ”‚   โ”œโ”€โ”€ development
โ”‚   โ””โ”€โ”€ production
โ”œโ”€โ”€ src                      # Source files
โ”‚   โ”œโ”€โ”€ images
โ”‚   โ”œโ”€โ”€ scripts
โ”‚   โ”œโ”€โ”€ styles
โ”‚   โ”‚   โ”œโ”€โ”€ partials
โ”‚   โ”‚   โ””โ”€โ”€ main.scss
โ”‚   โ”œโ”€โ”€ index.js
โ”‚   โ”œโ”€โ”€ template.html
โ”‚   โ””โ”€โ”€ vendor.js            # For all vendor js
โ”œโ”€โ”€ webpack                  # Webpack config files
โ”‚   โ”œโ”€โ”€ webpack.common.js
โ”‚   โ”œโ”€โ”€ webpack.dev.js
โ”‚   โ””โ”€โ”€ webpack.prod.js
โ””โ”€โ”€ ...

How to Start

You can start using this repo through

  1. Download

  2. Git

    • First, make sure you are in the new project file your created.
    • If you have not yet Initialized
      git init
      
    • Add this repo to git remote
      git remote add boilerplate [email protected]:Wangchimei/boilerplate-webpack-scss-babel.git
      
    • Pull the repo to your local directory
      git pull boilerplate master
      
    • Remove this remote URL from your repository
      git remote rm boilerplate
      

After you successfully download or pull from this repo

  • Install the dependencies

    npm install
    

Usage

Start a live reloading server in development

npm run serve

Build an application

  • For development
    npm run build:dev
    
  • For production
    npm run build
    
    or
    npm run build:prod
    

Remove files

  • Remove development files
    npm run clear:dev
    
  • Remove production files
    npm run clear:prod
    
  • Remove both development and production files
    npm run clear
    
  • Remove node_modules, development and production files
    npm run clear:all
    

Install Bootstrap on the fly

  • Only import Bootstrap CSS styles

    npm run set:bs:css
    

    Go to main.scss and import Bootstrap

    @import '~bootstrap';
    
  • Bootstrap + jQuery + Popper.js

    npm run set:bs:all
    

    Go to main.scss and import Bootstrap

    @import '~bootstrap';
    

    Go to vendor.js and import Bootstrap

    import 'bootstrap';
    

    Note: if you are okay with mixing your own js code with js from vendors, it is fine to put in index.js

    By running the commands above, you will install:

    • Bootstrap v4.4.1
    • jquery v3.4.1
    • popper.js v1.16.1

Uninstall Bootstrap / jQuery / Popper.js

npm run bs:clear

License

MIT

boilerplate-webpack-scss-babel's People

Contributors

wangchimei avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

smichaelsen

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.