asp.net core mvc 中间件之WebpackDevMiddleware
WebpackDevMiddleware
中间件主要用于开发SPA应用,启用Webpack
,增强网页开发体验。好吧,你想用来干嘛就干嘛,这次主要是通过学习该中间件,学习如何在core中启用Webpack
支持- 通过上上篇asp.net core mvc 管道之中间件,大致可以了解中间件是什么东西,现在就以中间件为单位,一个一个点学习各种中间件,了解并掌握,最后学会自己写中间件
- 该中间件源码
介绍
-
Enables Webpack dev middleware support. This hosts an instance of the Webpack compiler in memory
in your application so that you can always serve up-to-date Webpack-built resources without having
to run the compiler manually. Since the Webpack compiler instance is retained in memory, incremental
compilation is vastly faster that re-running the compiler from scratch.
Incoming requests that match Webpack-built files will be handled by returning the Webpack compiler
output directly, regardless of files on disk. If compilation is in progress when the request arrives,
the response will pause until updated compiler output is ready. - 大概意思是
Webpack
编译器实例存在于内存,比重新运行速度要快。另外通过代理