Skip to content
This repository has been archived by the owner on Apr 9, 2023. It is now read-only.

Feature Request: Use compiler.outputFileSystem #195

Closed
mwaldstein opened this issue May 13, 2018 · 3 comments
Closed

Feature Request: Use compiler.outputFileSystem #195

mwaldstein opened this issue May 13, 2018 · 3 comments

Comments

@mwaldstein
Copy link

While less common, I was in a scenario where I wanted to run a development server using a production configuration using webpack-dev-middleware. While native webpack outputs went into its MemoryFS, prerender-spa-plugin still wrote to the native filesystem.

This is a low priority, but it would be nice if the compiler's outputFileSystem were used for writing if set.

References:

@JoshTheDerf
Copy link
Collaborator

@mwaldstein Hmm, would it be possible to simply replace references to fs with compiler.outputFileSystem? Just curious, as that does seem like a good idea.

@mwaldstein
Copy link
Author

I believe so - A rather cursory examination suggests that outputFileSystem has the following interface:

https://github.com/webpack/webpack/blob/eca7bad8de54c39b9cb8b138793362b8a17ac11b/lib/node/NodeOutputFileSystem.js

So I think the changes would be to change the fs.writeFile and mkdirp calls to compiler.outputFileSystem calls...

@JoshTheDerf
Copy link
Collaborator

JoshTheDerf commented Jun 1, 2018

Should be implemented now in 8d1bae9!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants