1

I learned react with the old "create-react-app" way of initializing a new project. I recently came across Vite and decided to switch. One of the differences in file structure that I noticed is that instead of creating index.js, Vite uses main.jsx.

However, I see that the corresponding CSS for the main.jsx is still index.css, so I decided to rename the main.jsx to index.jsx (yes, I have OCD). I also edited the script part in index.html to refer to index.jsx instead of main.jsx.

I wanted to make sure that this is all I needed to take care of for the renaming process and that this would not cause problems further down the line when I am making the production build.

user190245
  • 1,027
  • 1
  • 15
  • 31
Aslan
  • 27
  • 5

1 Answers1

1

No it won't cause any problem. It was changed from index.jsx to main.jsx for naming convention reasons. What your files are named doesn't matter, it could be "asdadas.jsx" as long as they're referenced correctly in the calling/parent file (in this case your index.html).

hypetf
  • 36
  • 3