A step-by-step guide on how to create a React project from scratch, with TypeScript and Webpack.

You can find the full source code  here.

Setup

Prerequisites:

  • node
  • yarn

Create the project’s folder:

mkdir react-app
cd react-app

Generate a default package.json file with yarn:

yarn init -y

Install React, TypeScript and Webpack:

yarn add react react-dom

yarn add --dev @types/react \
        @types/react-dom \
        awesome-typescript-loader \
        css-loader \
        html-webpack-plugin \
        node-sass \
        sass-loader \
        style-loader \
        typescript \
        webpack \
        webpack-cli \
        webpack-dev-server

#react #typescript #webpack #reactjs #javascript

React App Configuration with TypeScript and Webpack
1.55 GEEK