Skip to content
Docs Try Aspire
Docs Try

JavaScriptAppResource

Handle
📦 Aspire.Hosting.JavaScript v13.3.0
interface JavaScriptAppResource
extends IComputeResource,
IResource,
IResourceWithArgs,
IResourceWithEndpoints,
IResourceWithEnvironment,
IResourceWithProbes,
IResourceWithWaitSupport,
IResourceWithContainerFiles,
IResourceWithServiceDiscovery {
publishAsNodeServer(
entryPoint: string,
outputPath?: string): JavaScriptAppResource;
publishAsNpmScript(
startScriptName?: string,
runScriptArguments?: string): JavaScriptAppResource;
publishAsStaticWebsite(
apiPath?: string,
apiTarget?: IResourceWithServiceDiscovery,
outputPath?: string,
stripPrefix?: boolean,
targetEndpointName?: string): JavaScriptAppResource;
withBrowserDebugger(browser?: string): JavaScriptAppResource;
withBuildScript(
scriptName: string,
args?: string[]): JavaScriptAppResource;
withBun(
install?: boolean,
installArgs?: string[]): JavaScriptAppResource;
withNpm(
install?: boolean,
installCommand?: string,
installArgs?: string[]): JavaScriptAppResource;
withPnpm(
install?: boolean,
installArgs?: string[]): JavaScriptAppResource;
withRunScript(
scriptName: string,
args?: string[]): JavaScriptAppResource;
withYarn(
install?: boolean,
installArgs?: string[]): JavaScriptAppResource;
}

Methods

method publishAsNodeServer builder
Publishes the JavaScript application as a standalone Node.js server that runs a built artifact directly.
publishAsNodeServer(
entryPoint: string,
outputPath?: string): JavaScriptAppResource
entryPoint string
outputPath string optional = .
JavaScriptAppResource
method publishAsNpmScript builder
Publishes the JavaScript application as a Node.js server that uses a package manager script at runtime.
publishAsNpmScript(
startScriptName?: string,
runScriptArguments?: string): JavaScriptAppResource
startScriptName string optional = start
runScriptArguments string optional
JavaScriptAppResource
Publishes the JavaScript application as a standalone static website using YARP.
publishAsStaticWebsite(
apiPath?: string,
apiTarget?: IResourceWithServiceDiscovery,
outputPath?: string,
stripPrefix?: boolean,
targetEndpointName?: string): JavaScriptAppResource
apiPath string optional
apiTarget IResourceWithServiceDiscovery optional
outputPath string optional = dist
stripPrefix boolean optional = False
targetEndpointName string optional
JavaScriptAppResource
method withBrowserDebugger builder
Configures a browser debugger for the JavaScript application
withBrowserDebugger(browser?: string): JavaScriptAppResource
browser string optional = msedge
JavaScriptAppResource
method withBuildScript builder
Specifies an npm script to run before starting the application
withBuildScript(
scriptName: string,
args?: string[]): JavaScriptAppResource
scriptName string
args string[] optional
JavaScriptAppResource
method withBun builder
Configures Bun as the package manager
withBun(
install?: boolean,
installArgs?: string[]): JavaScriptAppResource
install boolean optional = True
installArgs string[] optional
JavaScriptAppResource
method withNpm builder
Configures npm as the package manager
withNpm(
install?: boolean,
installCommand?: string,
installArgs?: string[]): JavaScriptAppResource
install boolean optional = True
installCommand string optional
installArgs string[] optional
JavaScriptAppResource
method withPnpm builder
Configures pnpm as the package manager
withPnpm(
install?: boolean,
installArgs?: string[]): JavaScriptAppResource
install boolean optional = True
installArgs string[] optional
JavaScriptAppResource
method withRunScript builder
Specifies an npm script to run during development
withRunScript(
scriptName: string,
args?: string[]): JavaScriptAppResource
scriptName string
args string[] optional
JavaScriptAppResource
method withYarn builder
Configures yarn as the package manager
withYarn(
install?: boolean,
installArgs?: string[]): JavaScriptAppResource
install boolean optional = True
installArgs string[] optional
JavaScriptAppResource