JavaScriptHostingExtensions
Class static net8.0
Provides extension methods for adding JavaScript applications to an
Hosting.IDistributedApplicationBuilder. namespace Aspire.Hosting;
public static class JavaScriptHostingExtensions{ // ...} 11 members
Methods11
Section titled MethodsAddJavaScriptApp(IDistributedApplicationBuilder, string, string, string)extensionats exportIResourceBuilder<JavaScriptAppResource> Adds a JavaScript application resource to the distributed application using the specified app directory and run script.
AddNodeApp(IDistributedApplicationBuilder, string, string, string)extensionats exportIResourceBuilder<NodeAppResource> Adds a node application to the application model. Node should be available on the PATH.
AddViteApp(IDistributedApplicationBuilder, string, string, string)extensionats exportIResourceBuilder<ViteAppResource> Adds a Vite app to the distributed application builder.
WithBrowserDebugger(IResourceBuilder<T>, string)extensionexperimentalats exportIResourceBuilder<T> Configures a browser debugger for the JavaScript application resource, enabling browser-based debugging through a child resource that launches when the parent application is ready.
WithBuildScript(IResourceBuilder<TResource>, string, string[]?)extensionats exportIResourceBuilder<TResource> Adds a build script annotation to the resource builder using the specified command-line arguments.
WithBun(IResourceBuilder<TResource>, bool, string[]?)extensionats exportIResourceBuilder<TResource> Configures the JavaScript resource to use Bun as the package manager and optionally installs packages before the application starts.
WithNpm(IResourceBuilder<TResource>, bool, string?, string[]?)extensionats exportIResourceBuilder<TResource> Configures the Node.js resource to use npm as the package manager and optionally installs packages before the application starts.
WithPnpm(IResourceBuilder<TResource>, bool, string[]?)extensionats exportIResourceBuilder<TResource> Configures the Node.js resource to use pnpm as the package manager and optionally installs packages before the application starts.
WithRunScript(IResourceBuilder<TResource>, string, string[]?)extensionats exportIResourceBuilder<TResource> Adds a run script annotation to the specified JavaScript application resource builder, specifying the script to execute and its arguments during run mode.
WithViteConfig(IResourceBuilder<ViteAppResource>, string)extensionats exportIResourceBuilder<ViteAppResource> Configures the Vite app to use the specified Vite configuration file instead of the default resolution behavior.
WithYarn(IResourceBuilder<TResource>, bool, string[]?)extensionats exportIResourceBuilder<TResource> Configures the Node.js resource to use yarn as the package manager and optionally installs packages before the application starts.