79131083

Date: 2024-10-27 17:07:32
Score: 0.5
Natty:
Report link

src/main.tsx is a source file. when you access files trough the webbrowser you are typically only able to access public files (the files in your dist/ folder when you do vite build)

the main.tsx file is not in there because the source code of your site is often sensative information that you dont want random people to be able to read

normally the compiler compiles the tsx files into raw html/js/css that is bundled together in minimized files. those files are the ones ending up being distributed in /dist/

if you (for some reason, not recommended) want that main.tsx file to be copied to your dist folder without being altered in name and content. you could use vite-plugin-static-copy. which is a plugin meant to copy static files into your build output

https://www.npmjs.com/package/vite-plugin-static-copy

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Luke_