SolidStart 目前依赖于 Bun 尚未实现的 Node.js API。以下指南使用 Bun 初始化项目并安装依赖项,但使用 Node.js 运行开发服务器。
使用 create-solid
初始化 SolidStart 应用。
bun create solid my-app
create-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-app
bun install
然后运行开发服务器。
bun run dev
# or, equivalently
bunx solid-start dev
打开 localhost:3000。对 src/routes/index.tsx
所做的任何更改都将自动热重载。
有关完整的框架文档,请参阅 SolidStart 网站。