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 網站 以取得完整的架構文件。