Giter Club home page Giter Club logo

react-webpack's Introduction

React with Webpack

Create a React application manually with webpack

Though it is painless to get started with create-react-app to make your own React application, it is however beneficial in some cases to manually configure your own application. 'create-react-app' does a lot of things for you which may or may not meet the needs of your project. So knowing how to configure your own React application can come in handy.

Installation

Install and get this project up and running just like any other React application

npm install
npm start

Notice that in package.json, the scripts for building and starting the application use the webpack instead of the traditional react-scripts.

Configuration

This application has been configured the following way through the webpack.config.js file:

  • It's entry point is the file index.js
  • The output of build is minified and stored in main.js
  • It has an integrated devServer that runs on the port 3000 and has hot enabled which allows live reloading
  • It has a source-map devtool integrated which will allow easy debugging of the application in case of errors from browser Dev Tools. For example, without source-map, you might not be able to trace the line causing error from the browser inspection panel. It will give you an unfamiliar snippet of code. source-map fixes this and shows you your familiar code inside the browser console.
  • It has a few rules integrated such as loaders for babel, which will eventually transpile all code to JavaScript so it can be displayed in the browser. This allows you to code using ES6 or TypeScript. Similarly, we have a CSS loader to transpile CSS or SCSS code.

There are numerous rules that you can set in this configuration file to meet your organizational and personal needs for the project.

react-webpack's People

Contributors

tayyabataimur avatar

Stargazers

Aashir Javed 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.