Watch Aspire live streamsDocsTry Aspire
Watch Aspire live streamsDocsTry

Aspire.Hosting.JavaScript

Official
📦 Aspire.Hosting.JavaScriptv13.6.0
35Functions
9Types

Types

Functions

methodaddBunAppbuilder
Adds a Bun application to the application model. Bun should be available on the PATH.
addBunApp(name: string, appDirectory: string, scriptPath: string): BunAppResource
methodaddDenoAppbuilder
Adds a Deno application to the application model. Deno should be available on the PATH.
addDenoApp(name: string, appDirectory: string, scriptPath: string): DenoAppResource
methodaddJavaScriptAppbuilder
Adds a JavaScript application resource to the distributed application using the specified app directory and run script.
addJavaScriptApp(name: string, appDirectory: string, runScriptName?: string): JavaScriptAppResource
methodaddNextJsAppbuilder
Adds a Next.js app to the distributed application builder.
addNextJsApp(name: string, appDirectory: string, runScriptName?: string): NextJsAppResource
methodaddNodeAppbuilder
Adds a node application to the application model. Node should be available on the PATH.
addNodeApp(name: string, appDirectory: string, scriptPath: string): NodeAppResource
methodaddViteAppbuilder
Adds a Vite app to the distributed application builder.
addViteApp(name: string, appDirectory: string, runScriptName?: string): ViteAppResource
methoddisableBuildValidationbuilder
Disables deploy-time build validation checks for the Next.js application.
disableBuildValidation(): NextJsAppResource
methodpublishAsNodeServerbuilder
Configures the JavaScript application to publish as a standalone Node.js server that runs a built artifact directly.
publishAsNodeServer(entryPoint: string, outputPath?: string): JavaScriptAppResource
methodpublishAsPackageScriptbuilder
Configures the JavaScript application to publish as a server that runs a package manager script at runtime.
publishAsPackageScript(scriptName?: string, runScriptArguments?: string): JavaScriptAppResource
methodpublishAsStaticWebsitebuilder
Publishes the JavaScript application as a standalone static website using YARP.
publishAsStaticWebsite(apiPath?: string, apiTarget?: IResourceWithServiceDiscovery, outputPath?: string, stripPrefix?: boolean, targetEndpointName?: string): JavaScriptAppResource
methodwithBrowserDebuggerbuilder
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.
withBrowserDebugger(browser?: string): JavaScriptAppResource
methodwithBuildScriptbuilder
Adds a build script annotation to the resource builder using the specified command-line arguments.
withBuildScript(scriptName: string, args?: string[]): JavaScriptAppResource
methodwithBunbuilder
Configures the JavaScript resource to use Bun as the package manager and optionally installs packages before the application starts.
withBun(install?: boolean, installArgs?: string[]): JavaScriptAppResource
methodwithDenobuilder
Configures the JavaScript resource to use Deno as the package manager.
withDeno(install?: boolean, installArgs?: string[]): JavaScriptAppResource
methodwithDenoAllowbuilder
Grants a Deno permission, optionally scoped to the supplied values.
withDenoAllow(kind: DenoPermissionKind, values: string[]): DenoAppResource
methodwithDenoAllowAllbuilder
Controls the blanket `-A`/`--allow-all` grant.
withDenoAllowAll(enabled?: boolean): DenoAppResource
methodwithDenoConfigbuilder
Sets `--config <file>` (path to a `deno.json`/`deno.jsonc`).
withDenoConfig(configFile: string): DenoAppResource
methodwithDenoDenybuilder
Denies a Deno permission, optionally scoped to the supplied values.
withDenoDeny(kind: DenoPermissionKind, values: string[]): DenoAppResource
methodwithDenoImportMapbuilder
Sets `--import-map <file>`.
withDenoImportMap(importMapFile: string): DenoAppResource
methodwithDenoInspectbuilder
Enables a Deno inspector mode, optionally at `hostPort` (for example `127.0.0.1:9229`).
withDenoInspect(mode?: DenoInspectMode, hostPort?: string): DenoAppResource
methodwithDenoLockbuilder
Sets `--lock <file>`.
withDenoLock(lockFile: string): DenoAppResource
methodwithDenoNodeModulesDirbuilder
Sets `--node-modules-dir`, optionally with a mode emitted as `--node-modules-dir=<mode>`.
withDenoNodeModulesDir(mode?: DenoNodeModulesDirMode): DenoAppResource
methodwithDenoNoLockbuilder
Sets `--no-lock`, disabling lockfile use.
withDenoNoLock(): DenoAppResource
methodwithDenoRunbuilder
Selects the `deno run <entrypoint>` mode (the default).
withDenoRun(): DenoAppResource
methodwithDenoRuntimeArgsbuilder
Appends raw runtime arguments injected verbatim BEFORE the entrypoint. This is the escape hatch that gives full parity with `AddExecutable("name", "deno", workdir, args...)` for any flag not covered by a dedicated `WithDeno*` method.
withDenoRuntimeArgs(args: string[]): DenoAppResource
methodwithDenoScriptArgsbuilder
Appends arguments passed to the script AFTER the entrypoint. Deno forwards everything after the entrypoint to the running program.
withDenoScriptArgs(args: string[]): DenoAppResource
methodwithDenoServebuilder
Selects the `deno serve <entrypoint>` mode for serving an HTTP entrypoint.
withDenoServe(): DenoAppResource
methodwithDenoTaskbuilder
Selects the `deno task <taskName>` mode, running a task defined in `deno.json` instead of a script entrypoint. Permissions are defined by the task itself and are not emitted for this mode.
withDenoTask(taskName: string): DenoAppResource
methodwithDenoUnstablebuilder
Adds one or more `--unstable-*` flags. Each feature may be supplied bare (for example `"kv"`, `"worker-options"`, `"sloppy-imports"`) or fully qualified (`"--unstable-kv"`).
withDenoUnstable(features: string[]): DenoAppResource
methodwithDenoWatchbuilder
Enables `--watch` (or `--watch-hmr` when `hmr` is `true`).
withDenoWatch(hmr?: boolean): DenoAppResource
methodwithNpmbuilder
Configures the Node.js resource to use npm as the package manager and optionally installs packages before the application starts.
withNpm(install?: boolean, installCommand?: string, installArgs?: string[]): JavaScriptAppResource
methodwithPnpmbuilder
Configures the Node.js resource to use pnpm as the package manager and optionally installs packages before the application starts.
withPnpm(install?: boolean, installArgs?: string[]): JavaScriptAppResource
methodwithRunScriptbuilder
Adds a run script annotation to the specified JavaScript application resource builder, specifying the script to execute and its arguments during run mode.
withRunScript(scriptName: string, args?: string[]): JavaScriptAppResource
methodwithViteConfigbuilder
Configures the Vite app to use the specified Vite configuration file instead of the default resolution behavior.
withViteConfig(configPath: string): ViteAppResource
methodwithYarnbuilder
Configures the Node.js resource to use yarn as the package manager and optionally installs packages before the application starts.
withYarn(install?: boolean, installArgs?: string[]): JavaScriptAppResource

Enums