WebpackDevMiddleware.UseWebpackDevMiddleware 方法

定义

注意

Use Microsoft.AspNetCore.SpaServices.Extensions

启用 Webpack 开发中间件支持。 这会在应用程序中的内存中托管 Webpack 编译器的实例,以便你可以始终提供最新的 Webpack 生成的资源,而无需手动运行编译器。 由于 Webpack 编译器实例保留在内存中,因此增量编译比从头开始重新运行编译器要快得多。

与 Webpack 生成的文件匹配的传入请求将通过直接返回 Webpack 编译器输出来处理,而不考虑磁盘上的文件。 如果在请求到达时正在进行编译,响应将暂停,直到更新的编译器输出准备就绪。

public static void UseWebpackDevMiddleware (this Microsoft.AspNetCore.Builder.IApplicationBuilder appBuilder, Microsoft.AspNetCore.SpaServices.Webpack.WebpackDevMiddlewareOptions options = default);
[System.Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")]
public static void UseWebpackDevMiddleware (this Microsoft.AspNetCore.Builder.IApplicationBuilder appBuilder, Microsoft.AspNetCore.SpaServices.Webpack.WebpackDevMiddlewareOptions options = default);
static member UseWebpackDevMiddleware : Microsoft.AspNetCore.Builder.IApplicationBuilder * Microsoft.AspNetCore.SpaServices.Webpack.WebpackDevMiddlewareOptions -> unit
[<System.Obsolete("Use Microsoft.AspNetCore.SpaServices.Extensions")>]
static member UseWebpackDevMiddleware : Microsoft.AspNetCore.Builder.IApplicationBuilder * Microsoft.AspNetCore.SpaServices.Webpack.WebpackDevMiddlewareOptions -> unit
<Extension()>
Public Sub UseWebpackDevMiddleware (appBuilder As IApplicationBuilder, Optional options As WebpackDevMiddlewareOptions = Nothing)

参数

options
WebpackDevMiddlewareOptions

用于配置 Webpack 编译器实例的选项。

属性

适用于