Wiring TypeScript Into React

Image result for typescript react
Wiring TypeScript Into React video
npm install --save-dev typescript awesome-typescript-loader
npm install --save @types/react @types/react-dom @types/prop-types
{
"compilerOptions": {
"outDir": "./dist/",
"sourceMap": true,
"module": "commonjs",
"target": "es5",
"jsx": "react"
},
"include": [
"./src/**/*"
]
}
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: './index.js',
mode: 'development',
output: {
path: path.resolve(__dirname, 'build'),
filename: 'bundle.js'
},
resolve: {
extensions: [".ts", ".tsx", ".js", ".json"]
},
module: {
rules: [
{ test: /\.tsx?$/, loader: "awesome-typescript-loader" },
{ test: /\.js$/, loader: 'babel-loader', query: { presets: ['es2015', 'react'] }}
]
},
stats: {
colors: true
},
devtool: 'source-map'
};

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store