Files being written to disk with WebpackDevMiddleware #6

Closed
opened 2025-08-09 17:14:38 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @ernestopye on 11/9/2018

Hello, if possible I'd really appreciate getting clarification on something. I may be doing something wrong, and I really hope that's the case. The issue I'm running into right now is with a .NET Core 2.1 webapp using WebpackDevMiddleware.

My understanding from the following page, is that files do not need to be written to disk:
https://github.com/aspnet/JavaScriptServices/tree/master/src/Microsoft.AspNetCore.SpaServices#webpack-dev-middleware

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.

Is this perhaps outdated? Or is something wrong with my setup? The files are currently being written to my dist/ folder whenever a change is made. I can delete the files from there and the site continues to function, so they're stored in memory somewhere. This of course isn't ideal as it'll get slower as our app gets larger (it seems to wait for all files to be written before the process completes).

I've created a minimal repro for this. This is just a plain web application without any SPA code, to which I added the required NPM modules and the ASP.NET Webpack Dev Middleware:
https://github.com/ernestopye/webpack-middleware-repro

Anyway, maybe it's just not how it's supposed to work, or perhaps I've got something setup incorrectly. A project we're working on is using Babel/TypeScript/HMR/etc. I started removing pieces and I couldn't get this to just work as (I think) it's supposed to.

*Originally created by @ernestopye on 11/9/2018* Hello, if possible I'd really appreciate getting clarification on something. I may be doing something wrong, and I really hope that's the case. The issue I'm running into right now is with a .NET Core 2.1 webapp using WebpackDevMiddleware. My understanding from the following page, is that files do not need to be written to disk: https://github.com/aspnet/JavaScriptServices/tree/master/src/Microsoft.AspNetCore.SpaServices#webpack-dev-middleware > 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.* Is this perhaps outdated? Or is something wrong with my setup? The files are currently being written to my `dist/` folder whenever a change is made. I can delete the files from there and the site continues to function, so they're stored in memory somewhere. This of course isn't ideal as it'll get slower as our app gets larger (it seems to wait for all files to be written before the process completes). I've created a minimal repro for this. This is just a plain web application without any SPA code, to which I added the required NPM modules and the ASP.NET Webpack Dev Middleware: https://github.com/ernestopye/webpack-middleware-repro Anyway, maybe it's just not how it's supposed to work, or perhaps I've got something setup incorrectly. A project we're working on is using Babel/TypeScript/HMR/etc. I started removing pieces and I couldn't get this to just work as (I think) it's supposed to.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#6
No description provided.