React, Webpack and Babel from scratch

Joshua Crass
4 min readSep 10, 2018

Find yourself ejecting CRA? Want to understand Webpack basics and how-to set up your development environment for React from scratch? Webpack may sound daunting, but it's not and this should help. There are several great Webpack courses out there. This is just intended to get you started.

If you are new to React and just getting started, I would suggest turning to create-react-app or Gatsby. This is intended for someone that wishes to roll their own and learn a bit more about Webpack and Babel. This also assumes you are familiar with the CLI.

Setup

From the CLI, create a new directory for your new project (e.g. react-starter)

mkdir react-starter

Change directories into the new project

cd react-starter

Package Management Setup

Initialize your project by running yarn init and answering the questions on the CLI. See an example package.json.

yarn init

name (react-starter): Hit enter or type the name of your project
version (1.0.0): Hit enter or set the version of your choice
description: It's up to you
question entry point: index.jsx
repository URL: If applicable, enter the remote repository URL
author: That's you
license (MIT): Hit enter

--

--