aspnet / JavaScriptServices

[Archived] This repository has been archived
Apache License 2.0
3.03k stars 518 forks source link

Webpack dev middleware writes files to disk #1480

Closed simmo closed 6 years ago

simmo commented 6 years ago

Title

Webpack dev middleware writes files to disk Documentation states;

They don't need to be written to disk - they are just held in memory and served directly to the browser.

(Ref: https://github.com/aspnet/JavaScriptServices/tree/dev/src/Microsoft.AspNetCore.SpaServices#webpack-dev-middleware)

Currently when I run the project (unedited, generated React/Redux template) files are written to the dist.

Apologies if I'm not running it correctly! 😄

Functional impact

Files are written to disk, they shouldn't be.

Minimal repro steps

  1. dotnet new reactredux
  2. dotnet run
  3. View wwwroot/dist, directory and contents will be visible

Expected result

dist directory to be non-existant, files to be served without disk write.

Actual result

dist and all files are built and written to disk.

Further technical details

When using Webpack's dev server/middleware files are not written to disk, they are served from memory only. I can only assume there is a config issue somewhere.

SteveSandersonMS commented 6 years ago

I think you must be using the pre-Create-React-App template, which does indeed do this as a way of signalling to the server-side rendering process that it needs to restart. You're correct that the docs are wrong on this subject, so my apologies that.

Since the pre-Create-React-App template (along with all its docs) is about to be superseded by the newer Create-React-App-based template, and since it doesn't cause any urgent problem in the meantime, the issue will go away on its own within the next few weeks, so I'll mark this closed now.