evanw / esbuild

An extremely fast bundler for the web
https://esbuild.github.io/
MIT License
38.21k stars 1.15k forks source link

Support using a `fs.FS` for input and output files #3954

Open xremming opened 3 weeks ago

xremming commented 3 weeks ago

I am building a deep integration with ESBuild to my Go application. Due to how it works, some of the files are embedded, and some are on the filesystem, and all access to files happen through the fs.FS interface.

In essence, I would like to be able to pass an fs.FS interface to all of the different methods and functions and for ESBuild to use it for all file accesses. Another separate fs.FS should be available to be passed for the output (as the embed.FS is read-only).

It should be a relatively straightforward change, but as I don't know the codebase, I cannot be sure.