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 網站。