Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
300 views
in Technique[技术] by (71.8m points)

typescript - Understanding react-native init template and files: What are all these files?

Today I started to play around with a fresh React Native project. I ran the basic react-native init command and got the sample project littered with all these weird files. Are all of these necessary and what are they?


.buckconfig

This seems to be related to a RN build tool called "Buck" made by Facebook. Is this used by default in the freshly initialise project? How can I check what builder is being used?


.flowconfig

Never heard of this before. Short googling gave me the understanding that this is some sort of type checker for JS. I am using TypeScript, so I think there's no need for this config file to be present?


.watchmanconfig

Empty watchmanconfig in the project root? Why? What's the point in having this there?

Edit: Apparently it is safe to delete from the project as long as it is not too large

Do I need to keep .watchmanconfig file in react-native project?


babel.config.json

Then probably the most confusing of them all for me was surprisingly Babel config. Babel has been present in many projects I have been working on. Always they have been some already initialised projects and I have never needed to pay much attention to the configuration details - hence this post. If using TypeScript and tsc, what do we need Babel for? Isn't tsc already transpiling the TypeScript code?


For a test I deleted all of the above files from my test project and it still seems to build and work just fine. I am now thinking that could this lead to some problems later in the development?

I like to keep my projects as clean as possible from all trash, so they are nicer to develop and easier to understand as there are less random stuff floating around.

question from:https://stackoverflow.com/questions/65643495/understanding-react-native-init-template-and-files-what-are-all-these-files

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...