Anubhav Sarkar

Setup a React App using Webpack, Babel and TypeScript

Setup a React App using Webpack, Babel and TypeScript

Subscribe to my newsletter and never miss my upcoming articles

Listen to this article

This article is part of a two part series on how to configure a React app from scratch with Webpack and Babel and eventually add TypeScript to it. To read the first article in this series, click on the below link.


So you stumbled upon TypeScript and loved how you will be able to add type safety along with a whole bunch of other things that it has to offer. So, let's modify last week's app and add TypeScript to it. In case you haven't read last week's article on how to setup a react app with webpack and babel, feel free to go through the below link and setup a basic react app to which we can add TypeScript.

To get the starter code click on this below link.

Link to the GitHub repo: react-with-webpack


Let's start with the required steps now.

  1. Install the following packages typescript, npm install typescript npm install @types/react @types/react-dom --save-dev

Well, you have successfully added TypeScript to your project. Go ahead and make use of its functionalities to build great webapps.

Have a great day. Thanks for reading the entire thing.

Here's the link to the Github Repo in case you have faced some issue during the entire process. Feel free to make some tweaks if you find something breaking because of updates to any of the packages.

Cover Photo by Cristina G d

#typescript#reactjs#webpack#babel#javascript
 
Share this