From 4293459b73db6cc2d696e2267f70be8464e782fd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 23 Jan 2026 15:58:49 +0000 Subject: [PATCH 1/3] Initial plan From f4ed412d5863552fe82fef2d7b1f2948a89d4185 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 23 Jan 2026 16:08:35 +0000 Subject: [PATCH 2/3] Add WithBun() documentation to JavaScript integration page Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com> --- .../integrations/frameworks/javascript.mdx | 37 ++++++++++++++++++- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/content/docs/integrations/frameworks/javascript.mdx b/src/frontend/src/content/docs/integrations/frameworks/javascript.mdx index 81701518..494e61dc 100644 --- a/src/frontend/src/content/docs/integrations/frameworks/javascript.mdx +++ b/src/frontend/src/content/docs/integrations/frameworks/javascript.mdx @@ -18,7 +18,7 @@ import jsIcon from '@assets/icons/javascript.svg'; data-zoom-off /> -The Aspire JavaScript/TypeScript hosting integration enables you to orchestrate JavaScript applications alongside your Aspire projects in the AppHost. This integration provides a unified approach to running JavaScript applications with support for multiple package managers (npm, yarn, pnpm), runtimes (Node.js), and build tools (Vite, and more). +The Aspire JavaScript/TypeScript hosting integration enables you to orchestrate JavaScript applications alongside your Aspire projects in the AppHost. This integration provides a unified approach to running JavaScript applications with support for multiple package managers (npm, yarn, pnpm, bun), runtimes (Node.js), and build tools (Vite, and more). :::tip[Package rename] In Aspire 13.0, the `Aspire.Hosting.NodeJs` package was renamed to `Aspire.Hosting.JavaScript` to better reflect its broader support for JavaScript applications. @@ -106,7 +106,7 @@ var viteApp = builder.AddViteApp("vite-app", "./vite-app") - **Development script**: Runs the "dev" script (typically `vite`) during local development - **Build script**: Runs the "build" script (typically `vite build`) when publishing -- **Package manager**: Uses npm by default, but can be customized with `WithYarn()` or `WithPnpm()` +- **Package manager**: Uses npm by default, but can be customized with `WithYarn()`, `WithPnpm()`, or `WithBun()` The method accepts the same parameters as `AddJavaScriptApp`: @@ -183,6 +183,39 @@ var customApp = builder.AddJavaScriptApp("custom-app", "./custom-app") When publishing, Aspire uses `pnpm install --frozen-lockfile` if `pnpm-lock.yaml` exists, otherwise it uses `pnpm install`. +### Use Bun + +To use Bun as the package manager, call the `WithBun` extension method: + +```csharp title="C# — AppHost.cs" "WithBun" +var builder = DistributedApplication.CreateBuilder(args); + +var app = builder.AddViteApp("app", "./app") + .WithBun(); + +// Customize Bun with additional flags +var customApp = builder.AddViteApp("custom-app", "./custom-app") + .WithBun(installArgs: ["--frozen-lockfile"]); + +// After adding all resources, run the app... +``` + +When publishing, Aspire uses `bun install --frozen-lockfile` if `bun.lock` or `bun.lockb` exists, otherwise it uses `bun install`. + +Bun supports passing script arguments without the `--` separator, so commands like `bun run dev --port 3000` work without needing `bun run dev -- --port 3000`. + +When publishing to a container, `WithBun()` automatically configures a Bun build image (`oven/bun:1`) since Bun is not available in the default Node.js base images. To use a specific Bun version, configure a custom build image: + +```csharp title="C# — AppHost.cs" +var builder = DistributedApplication.CreateBuilder(args); + +var app = builder.AddViteApp("app", "./app") + .WithBun() + .WithDockerfileBaseImage(buildImage: "oven/bun:latest"); + +// After adding all resources, run the app... +``` + ## Customize scripts You can customize which scripts run during development and build: From 31c9ff4ad2fe2f49fc40383a498b1db3b5ca5275 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 23 Jan 2026 16:09:27 +0000 Subject: [PATCH 3/3] Update Bun example to use specific version tag Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com> --- .../src/content/docs/integrations/frameworks/javascript.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/src/content/docs/integrations/frameworks/javascript.mdx b/src/frontend/src/content/docs/integrations/frameworks/javascript.mdx index 494e61dc..42d642ca 100644 --- a/src/frontend/src/content/docs/integrations/frameworks/javascript.mdx +++ b/src/frontend/src/content/docs/integrations/frameworks/javascript.mdx @@ -211,7 +211,7 @@ var builder = DistributedApplication.CreateBuilder(args); var app = builder.AddViteApp("app", "./app") .WithBun() - .WithDockerfileBaseImage(buildImage: "oven/bun:latest"); + .WithDockerfileBaseImage(buildImage: "oven/bun:1.1"); // After adding all resources, run the app... ```