Rahul Chandwani
Rahul Chandwani

Reputation: 61

Hoes does the code get transpiled to javascript in a project created using create-react-app?

Hoes does the code get transpiled to javascript in a project created using create-react-app --scripts-version=react-scripts-ts? Does it use Babel/Webpack? I have checked package.json but no mention of any such dependency.

Upvotes: 1

Views: 627

Answers (2)

PlayMa256
PlayMa256

Reputation: 6841

react-scripts* is just a wrapper for common configs.

As you can see here it uses babel-loader to convert from js/jsx to es5. Also uses ts-loader to compile from ts to js.

Upvotes: 2

dvvtms
dvvtms

Reputation: 627

yes, with babel:

https://github.com/facebook/create-react-app/blob/next/packages/react-scripts/package.json

the code for compilation is in react-scripts

Upvotes: 0

Related Questions