bun 是一种比 node/npm 更快的前端项目打包工具和JavaScript运行时,其目标是做到与nodejs 100%兼容。
官网:https://bun.sh/
中文文档:https://www.bunjs.com.cn/zh-cn/
我在 docker 中运行:
# 安装依赖
docker run --rm -it -v /vhost/hu60next:/vhost/hu60next -w /vhost/hu60next oven/bun:latest bun ci
# 构建
docker run --rm -it -v /vhost/hu60next:/vhost/hu60next -w /vhost/hu60next oven/bun:latest bun run build
# 运行
docker run -d --restart=always --name hu60next --network=host --user=nobody -it -v /vhost/hu60next:/vhost/hu60next -w /vhost/hu60next oven/bun:latest bun run start -- --hostname 0.0.0.0 --port 8083
构建速度提升明显吗?我的项目在服务器上要1分多钟