Giter VIP home page Giter VIP logo

webpack-4-react-bootstrap-starter-template's Introduction

Webpack 4 starter boilerplate template with React, Bootstrap 4

Starter template for projects that use Webpack 4 in conjunction with React, Bootstrap 4 and ES6 JavaScript. This project contains configuration for development and production deployment using the Webpack 4 module bundler and tools that might be helpful.

Getting started

Make sure to install all dependencies first, run npm -i (shorthand for npm install). Compatible with

Node 16.19.1 
npm i

To use configured development mode simply run

npm run start

To build all files for the production run

npm run build

An output is minified via --mode flag (default 'production' - already minified, optimized bundle) - additionally, the /dist directory is removed each time you run this script to make sure there are no artifacts left in the output location.

You can choose to export files in development mode (the output is not minimized or optimized). To use it, run

npm run dev

What's already configured?

  • React - create app components using Facebook's React Javascript UI library
  • Bootstrap 4 - popular framework for building responsive, mobile-first sites
  • Babel - transpile javascript ES6 code down to ES5
  • Extract Text Plugin - extract styles to separate files
  • SASS Loader - utilize modern SASS preprocessor to create styles for your app and compile them to .css
  • Html Webpack Plugin - allows use of predefined HTML template (entry file: ./src/index.html)
  • File Loader - allows use of media files in project via emitted URL
  • Image Webpack Loader - compress source images in build with imagemin
  • Webpack Dev Server - serves an app and opens a browser for development. Updates the browser on file changes.

Project structure

  • /src - here are all development files
  • /dist - production output, imported libraries are bundled into separated vendor.[hash].js, while rest of components are in app.[hash].js (same for styles)

Tools used to make life a little better

  • eslint - Javascript linter - configuration in eslintrc.json file
  • jshint - Javascript linter - configuration in .jshintrc file

License

This project is licensed under MIT license.

webpack-4-react-bootstrap-starter-template's People

Contributors

dependabot[bot] avatar shivero avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

webpack-4-react-bootstrap-starter-template's Issues

npm start & npm run dev not working

installed everything and then ran npm start or npm run dev but receiving this

ERROR in ./src/index.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: Cannot find module '/home/marcos/Documents/Projects/webpack-4-react-bootstrap-starter-template/node_modules/@babel/compat-data/data/corejs3-shipped-proposals'

any ideas?

im not understanding what is the index.js file doing

Babel dependencies error

Very new to javascript. There seems to be some error in the dependencies file. Had to run npm update --depth 5 @babel/preset-env to get it working

had this error:
ERROR in ./src/index.js Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Cannot find module '@babel/compat-data/corejs3-shipped-proposals'

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.