File emitting webpack middleware repro
This repository shows that a basic setup of Webpack Dev Middleware in .NET Core 2.1 does in fact write files to disk. To set this up:
- Clone
cd webpack-middleware-repro\WebpackMiddlewareRepro
npm install
dotnet run
Then simply modify either js file inside ClientApp\*
and watch what happens to wwwroot\dist\main.js
- if you delete the file, it'll just come back every time a change is made.
What's also interesting is that if you delete the file after it is generated, it'll continue to load if you just refresh the page.
Is this expected? I am referencing the following:
If you're using webpack, the webpack dev middleware feature included in Microsoft.AspNetCore.SpaServices will streamline your development process. It intercepts requests that would match files built by webpack, and dynamically builds those files on demand. They don't need to be written to disk - they are just held in memory and served directly to the browser.