Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using memfs to replace webpack/memory-fs #45

Closed
dai-shi opened this issue Oct 22, 2017 · 2 comments
Closed

Using memfs to replace webpack/memory-fs #45

dai-shi opened this issue Oct 22, 2017 · 2 comments

Comments

@dai-shi
Copy link

dai-shi commented Oct 22, 2017

Hi,
I'm trying to use memfs as well as unionfs and linkfs with webpack replacing memory-fs.

So far, I had two issues, which are actually not directly related to memfs though.

  • unionfs doesn't pass mkdirp, although memfs implements it.
    webpack requires mkdirp and my workaround is to patch it:
ufs1.mkdirp = (...args) => ufs1.asyncMethod('mkdirp', args);
if (func) func.apply(fs, args);

or something like this helps my case.

I could try preparing a PR, but I'd leave it for now as you might have a better design choice.

Thanks for your great work!

@streamich
Copy link
Owner

streamich commented Oct 22, 2017

Hi,

Thank you for finding that bug.

Regarding mkdirp, it is not a standard method and the idea behind memfs is to be a drop-in replacement for fs module. I am not keen on adding non-standard methods, in general.

However, mkdirp is implemented in memfs (and memory-fs as well) and apparently many people use that, so I included it in the list as an exception, unionfs should now pass it through:

streamich/fs-monkey@980c0d0

I've released a new version that should fix your issues:

npm i unionfs@2.0.7

Please tell me if it works.

@dai-shi
Copy link
Author

dai-shi commented Oct 22, 2017

@streamich Thanks for the instant fix. It's working. 😄

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

No branches or pull requests

2 participants