随笔分类 -  bun

摘要:Bun 本身内置了强大的打包/编译能力,能直接将 ElysiaJS 项目打包成无需依赖 Bun 运行时的单个可执行文件,下面我会一步步教你完整实现流程。 一、前置条件 确保你的开发环境满足: 已安装 Bun(推荐最新稳定版,执行 bun upgrade 可更新) 已有 ElysiaJS 项目(无项目 阅读全文
posted @ 2026-02-10 11:16 卓能文 阅读(34) 评论(0) 推荐(0)
摘要:index.ts: // this becomes an internal file path import html from "./index.html" with { type: "file" }; import { file } from "bun"; export default { fe 阅读全文
posted @ 2024-07-21 23:20 卓能文 阅读(43) 评论(0) 推荐(0)
摘要:import { Elysia } from 'elysia' const app = new Elysia() .get('/ok', function* () { yield 1 yield 2 yield 3 }) .listen(3000) 阅读全文
posted @ 2024-07-21 09:10 卓能文 阅读(26) 评论(0) 推荐(0)
摘要:server.ts: import { serve } from "bun"; const id = Math.random().toString(36).slice(2); serve({ port: process.env.PORT || 8080, development: false, // 阅读全文
posted @ 2024-07-21 08:28 卓能文 阅读(28) 评论(0) 推荐(0)