I started a react project using create-react-app few months ago and I\'m interesting in migrating the project from Javascript to Typescript.
I saw that there is a wa
You will need to eject a configuration in order to do that.
After ejecting you need to perform the following steps:
tsx
and ts
to the extensions
table
in the webpack configs (dev and prod).Add ts-loader. Here is an example
{
test: /\.(ts|tsx)$/,
include: paths.appSrc,
use: [
{
loader: require.resolve('ts-loader'),
},
],
},
Change eslint to tslint
Add source-map-loader to get a possibility to debug Typescript files.
{
test: /\.js$/,
loader: require.resolve('source-map-loader'),
enforce: 'pre',
include: paths.appSrc,
}
Create a Typescript config file and remember to set allowJs
to
true.