JavaScriptHostingExtensions.WithBuildScript<TResource> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Adds a build script annotation to the resource builder using the specified command-line arguments.
public static Aspire.Hosting.ApplicationModel.IResourceBuilder<TResource> WithBuildScript<TResource>(this Aspire.Hosting.ApplicationModel.IResourceBuilder<TResource> resource, string scriptName, string[]? args = default) where TResource : Aspire.Hosting.JavaScript.JavaScriptAppResource;
static member WithBuildScript : Aspire.Hosting.ApplicationModel.IResourceBuilder<'Resource (requires 'Resource :> Aspire.Hosting.JavaScript.JavaScriptAppResource)> * string * string[] -> Aspire.Hosting.ApplicationModel.IResourceBuilder<'Resource (requires 'Resource :> Aspire.Hosting.JavaScript.JavaScriptAppResource)> (requires 'Resource :> Aspire.Hosting.JavaScript.JavaScriptAppResource)
<Extension()>
Public Function WithBuildScript(Of TResource As JavaScriptAppResource) (resource As IResourceBuilder(Of TResource), scriptName As String, Optional args As String() = Nothing) As IResourceBuilder(Of TResource)
Type Parameters
- TResource
The type of JavaScript application resource being configured.
Parameters
- resource
- IResourceBuilder<TResource>
The resource builder to which the build script annotation will be added.
- scriptName
- String
The name of the script to be executed when the resource is built.
- args
- String[]
An array of command-line arguments to use for the build script.
Returns
The same resource builder instance with the build script annotation applied.
Remarks
Use this method to specify custom build scripts for JavaScript application resources during deployment.