Coder Social home page Coder Social logo

bootstrap-webpack-hello-world's Introduction

Bootstrap + Webpack Hello World Tutorial

Why did I create this?

If you just want to read the instructions, scroll down to the next header.

I created this project because I couldn't find any good existing documentation for how to setup a Bootstrap 4 project using Webpack 4. I intend to use it as a reference when I create my own projects in the future, and I hope others will also find it helpful for their projects.

Bootstrap's official documentation for using Webpack is very poor since it doesn't explain all the steps properly, and misses out some steps altogether. Additionally, it hasn't yet been updated for Webpack 4.

Another project exists which demonstrates a bare-bones Bootstrap + Webpack project, but like Bootstrap's official documentation, this has some problems - it's outdated, so also uses Webpack 3, and doesn't provide any instructions (only the finished result).

I spent a long time trying to figure out how to create a project, even with access to both of the resources above (and others), due to the changes with newer versions of dependent packages and lack of detailed information from the mentioned resources.

Instructions

  1. Create a new npm project:

    ~/Code $ mkdir bootstrap-webpack-hello-world  # or any other name
    ~/Code $ cd bootstrap-webpack-hello-world
    ~/Code/bootstrap-webpack-hello-world $ npm init
  2. Install the required development dependencies:

    # Webpack itself
    $ npm install --save-dev webpack webpack-cli
    
    # Babel (for ES6 to ES5 transpilation and bundling)
    $ npm install --save-dev "@babel-loader@^8.0.0-beta.2" @babel/core @babel/preset-env
    
    # Stylesheet tools (for SCSS to CSS transpilation and bundling)
    $ npm install --save-dev autoprefixer css-loader node-sass postcss-loader precss sass-loader style-loader
    
    # HTML Webpack Plugin (for automatic HTML generation)
    $ npm install --save-dev html-webpack-plugin
    
    # ESLint (for checking JavaScript code style)
    $ npm install --save-dev eslint
  3. Install the required production dependencies - Bootstrap, jQuery and Popper.js:

    $ npm install bootstrap jquery popper

bootstrap-webpack-hello-world's People

Contributors

valerie-makes avatar

Watchers

 avatar

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.