JavaScriptHostingExtensions
Class static net8.0
Provides extension methods for adding JavaScript applications to an
Hosting.IDistributedApplicationBuilder. namespace Aspire.Hosting;
public static class JavaScriptHostingExtensions{ // ...} 18 members
Methods18
Section titled MethodsAddBunApp(IDistributedApplicationBuilder, string, string, string)extensionats exportIResourceBuilder<BunAppResource> Adds a Bun application to the application model. Bun should be available on the PATH.
AddJavaScriptApp(IDistributedApplicationBuilder, string, string, string)extensionats exportIResourceBuilder<JavaScriptAppResource> Adds a JavaScript application resource to the distributed application using the specified app directory and run script.
AddNextJsApp(IDistributedApplicationBuilder, string, string, string)extensionexperimentalats exportIResourceBuilder<NextJsAppResource> Adds a Next.js app to the distributed application builder.
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.
DisableBuildValidation(IResourceBuilder<NextJsAppResource>)extensionexperimentalats exportIResourceBuilder<NextJsAppResource> Disables deploy-time build validation checks for the Next.js application.
PublishAsNodeServer(IResourceBuilder<TResource>, string, string)extensionexperimentalats exportIResourceBuilder<TResource> Configures the JavaScript application to publish as a standalone Node.js server that runs a built artifact directly.
PublishAsPackageScript(IResourceBuilder<TResource>, string, string?)extensionexperimentalats exportIResourceBuilder<TResource> Configures the JavaScript application to publish as a Node.js server that uses a
package.json script at runtime. PublishAsStaticWebsite(IResourceBuilder<TResource>, Action<PublishAsStaticWebsiteOptions>)extensionexperimentalats ignoredIResourceBuilder<TResource> Configures the JavaScript application to publish as a standalone static website served by YARP.
PublishAsStaticWebsite(IResourceBuilder<TResource>, string, IResourceBuilder<IResourceWithServiceDiscovery>, Action<PublishAsStaticWebsiteOptions>)extensionexperimentalats ignoredIResourceBuilder<TResource> Configures the JavaScript application to publish as a standalone static website served by YARP, with an API reverse-proxy to the specified resource.
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.