Docs: Is it main.ts or main.tsx
The very first page of the docs is a little unclear about whether the main file is main.tsx or main.ts.
It's a bit a of problem because as it stands, JSX can't be used within that particular file, as in the first example, but the configuration is not looking for main.tsx and fails with an error if you (naively) change the extension.
It is main.ts, main.tsx is not supported as the main entry point.
There may be some misleading examples in the documentation.
We should bring back support for main.tsx though. That was supported before moving to vite.
As someone else said, the simplicity of
app.get(() => <h1>Hello world!</h1>)
is a major selling point.
You can use main.tsx by updating vite.config.ts:
fresh({
serverEntry: "main.tsx",
}),
You can use main.tsx by updating vite.config.ts:
Oh, awesome.
Personally I think that the init project and the documentation should use main.tsx. I guess it's not possible to change the default at this point without breaking existing projects.