News & Announcements
Fresh out of the oven: Bun support in Builds
At Netlify we believe that stability and reliability don't necessarily need to conflict with one’s ability to experiment with new technologies. We're confident the same applies to the tooling we all use and, as such, it's our job as the platform of choice for web development to ensure our customers have access to ways they can safely experiment with new tools that could bring added value to their development process. We want to make sure Netlify is the right oven for any kind of project and team, hence why we're excited to announce Netlify Builds now have out of the box (or should we say out of the oven?) support for Bun.
Runtime? Package Manager?
- Just as we do for other JS runtimes such as Node.js and Deno we now expose the
bunexecutable at build time so that folks can run their build commands using
bunruntime if they choose to.
- Install and setup of JS dependencies by automatically detecting the presence of a Bun lockfile (
bun.lockb) and using
bun installwhen building a project in our platform.
How to use Bun with Netlify
You can start using
bun runtime right away by using the
bun executable in your build command. Either through your
[build] command = "bun run build"
Or by editing your build command in the configuration UI.
To leverage Bun's package manager capabilities you can do so by running
bun install locally in your project. This will generate a
bun.lockb file you should commit and push to your project (more details on Bun's lockfile can be found in their docs). When Netlify Build detects the presence of this file in your repository we'll run
bun install instead of
npm (our default package manager). It's that simple!
⚠️ Make sure you have no other lockfiles (
pnpm-lock.yaml) in your repo and no
packageManager option set in your
package.json since we'll be favouring those tools by default.
Check our docs for further information on how to configure Bun's package manager capabilities in Netlify.