Configurable file system via options.fs#370
Conversation
Changes: * fs option which can be used to configure non-default file system (it is forced to memory-fs in case it is not the same instance) * adding two simple tests
Codecov Report
@@ Coverage Diff @@
## master #370 +/- ##
==========================================
+ Coverage 96.85% 96.93% +0.08%
==========================================
Files 7 7
Lines 254 261 +7
==========================================
+ Hits 246 253 +7
Misses 8 8
Continue to review full report at Codecov.
|
|
Please accept CLA, please describe use case |
alexander-akait
left a comment
There was a problem hiding this comment.
Some little fixes for docs and we can merge
|
Waiting CI green and merge 👍 |
| if (isMemoryFs) { | ||
| if (isConfiguredFs) { | ||
| const { fs } = context.options; | ||
| if (typeof fs.join !== 'function') { |
There was a problem hiding this comment.
Just questions, can you find place where we use fs.join? Looks like we should remove this/deprecated from code base.
There was a problem hiding this comment.
It is not used by the webpack-middleware but rather by wepback instead. Here it is as a precaution to avoid digging up webpack's erros. If you attempt to provide fs without join() webpack will complain about it when accessing webpack.outputFileSystem.
I can switch to Russian to explain more if you like.
There was a problem hiding this comment.
I can switch to Russian to explain more if you like.
No need
It is not used by the
webpack-middlewarebut rather bywepbackinstead. Here it is as a precaution to avoid digging up webpack's erros. If you attempt to providefswithoutjoin()webpack will complain about it when accessingwebpack.outputFileSystem.
I think we should open issue in webpack and remove all fs.join in webpack@5, join is not part of fs and looks very dirty and misleading
Can you open issue?
There was a problem hiding this comment.
Well I got no time for that, sorry. May be next time.
There was a problem hiding this comment.
@hinell i mean just create issue in webpack repo and all, i am from mobile and it is hard for me right now
What kind of change does this PR introduce?
(currently, it is forced to use
memory-fsinstead)What are use cases?
Did you add tests for your changes?
Summary
webpackCompiler.outputFileSystemormiddleware(..., ..., { fs: fileSystem }Does this PR introduce a breaking change?