目前 Remix 开发服务器(
remix dev)依赖于 Bun 尚未实现的 Node.js API。下面的指南使用 Bun 来初始化项目和安装依赖,但启动开发服务器时会使用 Node.js。使用
create-remix 初始化一个 Remix 应用。
terminal
要启动开发服务器,从项目根目录运行
bun run dev。这将使用 remix dev 命令启动开发服务器。请注意,运行时仍然会使用 Node.js。
terminal
打开 http://localhost:3000 查看应用。对
app/routes/_index.tsx 的任何修改都会在浏览器中热重载。
要构建并启动你的应用,运行
bun run build
terminal
bun run start。
terminal
更多使用 Remix 构建应用的内容,请查阅 Remix 文档。