SolidStart 目前依赖于 Bun 尚未实现的 Node.js API。下面的指南使用 Bun 来初始化项目和安装依赖项,但使用 Node.js 来运行开发服务器。
使用 create-solid 初始化一个 SolidStart 应用。
bun create solid my-appcreate-solid version 0.2.31
Welcome to the SolidStart setup wizard!
There are definitely bugs and some feature might not work yet.
If you encounter an issue, have a look at
https://github.com/solidjs/solid-start/issues and open a new one,
if it is not already tracked.
✔ Which template do you want to use? › todomvc
✔ Server Side Rendering? … yes
✔ Use TypeScript? … yes
cloned solidjs/solid-start#main to /path/to/my-app/.solid-start
✔ Copied project files按照 create-solid CLI 的指示,安装我们的依赖项。
cd my-appbun install然后运行开发服务器。
bun run dev# or, equivalentlybunx solid-start dev打开 localhost:3000。对 src/routes/index.tsx 的任何更改都将自动热重载。
有关完整的框架文档,请参阅 SolidStart 网站。