-
Notifications
You must be signed in to change notification settings - Fork 70
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
Allow supplying our own fs
#92
Comments
Any hint or reason why? |
@oncletom Sorry for not explaining why. In my project's build process, I webpack the source and generate a manifest. I was attempting to use |
Hm, so if I understand well, you would like Isn't it solved by using the It looks like you could say |
@oncletom No, I use this module on the bundle generated by webpack. The build script is regular Node.js. |
I'm not sure to understand when you use To confirm, you use |
@oncletom Yes, I am trying to use |
OK, thanks for the link to webpack documentation. The example sounds clear and concise. By reading it, I understand Thanks for being patient. I have never used webpack, and I'm aware it may put quite some effort to explain all these stuff to me. Thanks for doing it 👍 |
@oncletom The output I don't know of anything that uses this in the wild, but here is the simplified part of my build script: const compiler = wp({
entry: "./src",
output: {
filename: "bundle.js",
path: "./bundled",
},
});
// set the output of the webpack compiler to the fake/memory filesystem
compiler.outputFileSystem = instanceOfMemoryFS;
compiler.run((err, info) => {
if (err) {
process.exit();
} else {
// so here's the problem: we have no option to load files from the fake/memory filesystem
// because of this, we can't use memory-fs
(new crx({})).load("./bundled").then(loaded => {
return loaded.pack();
}).then(buffer => {
// now, write the extension to the regular filesystem
fs.writeFile("./dist/chrome.crx", buffer);
});
}
}); |
Okay, I see what you mean. It is clear to me now. Thank you for the code snippet :-) I dug a bit in the code and most of the I/O operations are performed by I need to think more about how to design something nice. |
A way to achieve this is documented here archiverjs/node-archiver#216 |
Currently, this module uses the built-in
fs
module. However, it would be useful to be able to provide our own replacement using an option. We can check if it is compatible enough by checking if all thefs
methods that this module uses exist, and throw an error if not all of them are included.The text was updated successfully, but these errors were encountered: