Vue-CLI, .NET Core 3.1 Razor Pages and HMR

Viewed 248

With the depreciation of UseWebpackDevMiddleware in .NET Core 3.1 and it's pending removal entirely in .NET 5, I am currently at a loss for how I can replicate my current workflow.

Currently:

I remove the HMR provided by the Vue-CLI and replace it with the functionality provided by the above middleware, I do this primarily because I need to inject some state into the Vue app when it loads and this is achieved via the Razor page which serializes some data into it from the page model.


I know I can remove the HTML file generation using the vue.config.js file and I can also use the vue build --watch to get the rebundling of the files as they are being worked on but the last part of the puzzle is to restore the HMR functionality.

I do not want to use the UseSpaProxy as that would send me through to the Vue CLI index.html page, bypassing the Razor page.

I have also tried the Parcel Bundler which does get me part of the way along, but then more advanced features like option chaining seem to have issues at the moment, so if I can stick to the Vue CLI then that would solve everything.

0 Answers
Related