JavaScriptHostingExtensions
Classstaticnet10.0
Fluent flag-surface extensions for
DenoAppResource . namespace Aspire.Hosting;
public static class JavaScriptHostingExtensions{ // ...}36 members
Remarks
Section titled Remarks These methods let a caller express the full Deno CLI flag surface (permissions, resolution flags, unstable features, watch/inspect, sub-command modes, and script args) directly on
AddDenoApp , so a Deno workload no longer has to fall back to a raw AddExecutable("name", "deno", ...) . All methods mutate a single JavaScript.DenoCommandLineAnnotation ; flags compose regardless of call order and are emitted in valid Deno CLI order: deno <mode> [runtime-flags] <entrypoint> [script-args] . Methods36
Section titled MethodsIResourceBuilder<BunAppResource> Adds a Bun application to the application model. Bun should be available on the PATH.
IResourceBuilder<DenoAppResource> Adds a Deno application to the application model. Deno should be available on the PATH.
IResourceBuilder<JavaScriptAppResource> Adds a JavaScript application resource to the distributed application using the specified app directory and run script.
IResourceBuilder<NextJsAppResource> Adds a Next.js app to the distributed application builder.
IResourceBuilder<NodeAppResource> Adds a node application to the application model. Node should be available on the PATH.
IResourceBuilder<ViteAppResource> Adds a Vite app to the distributed application builder.
IResourceBuilder<NextJsAppResource> Disables deploy-time build validation checks for the Next.js application.
IResourceBuilder<TResource> Configures the JavaScript application to publish as a standalone Node.js server that runs a built artifact directly.
IResourceBuilder<TResource> Configures the JavaScript application to publish as a server that runs a package manager 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.
IResourceBuilder<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.
IResourceBuilder<TResource> Adds a build script annotation to the resource builder using the specified command-line arguments.
IResourceBuilder<TResource> Configures the JavaScript resource to use Bun as the package manager and optionally installs packages before the application starts.
IResourceBuilder<TResource> Configures the JavaScript resource to use Deno as the package manager.
WithDenoAllow(IResourceBuilder<DenoAppResource>, DenoPermissionKind, string[]) extensionexperimentalats exportIResourceBuilder<DenoAppResource> Grants a Deno permission, optionally scoped to the supplied values.
IResourceBuilder<DenoAppResource> Controls the blanket
-A / --allow-all grant. IResourceBuilder<DenoAppResource> Sets
--config <file> (path to a deno.json / deno.jsonc ).WithDenoDeny(IResourceBuilder<DenoAppResource>, DenoPermissionKind, string[]) extensionexperimentalats exportIResourceBuilder<DenoAppResource> Denies a Deno permission, optionally scoped to the supplied values.
IResourceBuilder<DenoAppResource> Sets
--import-map <file> .WithDenoInspect(IResourceBuilder<DenoAppResource>, DenoInspectMode, string?) extensionexperimentalats exportIResourceBuilder<DenoAppResource> Enables a Deno inspector mode, optionally at
hostPort (for example 127.0.0.1:9229).IResourceBuilder<DenoAppResource> Sets
--lock <file> .WithDenoNodeModulesDir(IResourceBuilder<DenoAppResource>, DenoNodeModulesDirMode?) extensionexperimentalats exportIResourceBuilder<DenoAppResource> Sets
--node-modules-dir , optionally with a mode emitted as --node-modules-dir=<mode> . IResourceBuilder<DenoAppResource> Sets
--no-lock , disabling lockfile use.IResourceBuilder<DenoAppResource> Selects the
deno run <entrypoint> mode (the default).IResourceBuilder<DenoAppResource> 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. IResourceBuilder<DenoAppResource> Appends arguments passed to the script AFTER the entrypoint. Deno forwards everything after the entrypoint to the running program.
IResourceBuilder<DenoAppResource> Selects the
deno serve <entrypoint> mode for serving an HTTP entrypoint.IResourceBuilder<DenoAppResource> 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. IResourceBuilder<DenoAppResource> Adds one or more
--unstable-* flags. Each feature may be supplied bare (for example "kv", "worker-options" , "sloppy-imports" ) or fully qualified ( "--unstable-kv" ). IResourceBuilder<DenoAppResource> Enables
--watch (or --watch-hmr when hmr is true).IResourceBuilder<TResource> Configures the Node.js resource to use npm as the package manager and optionally installs packages before the application starts.
IResourceBuilder<TResource> Configures the Node.js resource to use pnpm as the package manager and optionally installs packages before the application starts.
IResourceBuilder<TResource> Adds a run script annotation to the specified JavaScript application resource builder, specifying the script to execute and its arguments during run mode.
IResourceBuilder<ViteAppResource> Configures the Vite app to use the specified Vite configuration file instead of the default resolution behavior.
IResourceBuilder<TResource> Configures the Node.js resource to use yarn as the package manager and optionally installs packages before the application starts.