JavaScriptHostingExtensions
Class static net10.0
Provides extension methods for adding JavaScript applications to an
Hosting.IDistributedApplicationBuilder. namespace Aspire.Hosting;
public static class JavaScriptHostingExtensions{ // ...} 9 members
Methods9
Section titled MethodsAddJavaScriptApp(IDistributedApplicationBuilder, string, string, string)extensionIResourceBuilder<JavaScriptAppResource> Adds a JavaScript application resource to the distributed application using the specified app directory and run script.
AddNodeApp(IDistributedApplicationBuilder, string, string, string)extensionIResourceBuilder<NodeAppResource> Adds a node application to the application model. Node should be available on the PATH.
AddViteApp(IDistributedApplicationBuilder, string, string, string)extensionIResourceBuilder<ViteAppResource> Adds a Vite app to the distributed application builder.
WithBuildScript(IResourceBuilder<TResource>, string, string[]?)extensionIResourceBuilder<TResource> Adds a build script annotation to the resource builder using the specified command-line arguments.
WithNpm(IResourceBuilder<TResource>, bool, string?, string[]?)extensionIResourceBuilder<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[]?)extensionIResourceBuilder<TResource> Configures the Node.js resource to use pnmp as the package manager and optionally installs packages before the application starts.
WithRunScript(IResourceBuilder<TResource>, string, string[]?)extensionIResourceBuilder<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)extensionIResourceBuilder<ViteAppResource> Configures the Vite app to use the specified Vite configuration file instead of the default resolution behavior.
WithYarn(IResourceBuilder<TResource>, bool, string[]?)extensionIResourceBuilder<TResource> Configures the Node.js resource to use yarn as the package manager and optionally installs packages before the application starts.