Description
Description
When we write plugins or build tools using Vite's JS API, it would be nice to write in-memory e2e tests to check what is generated from a certain input. Now the Vite codebase is hardwired with the node:fs
module. Therefore, we cannot replace it with an in-memory implementation like memfs
to run our tools with an in-memory representation of files, then verify the results.
Suggested solution
Rollup just introduced this feature in: rollup@4.43.0
The corresponding issue and PR:
rollup/rollup#5880
rollup/rollup#5944
The solution could be that build
function could also take an fs
option, similarly to rollup:
https://rollupjs.org/configuration-options/#fs
Also, rollup is providing the fs option to the plugins in the context. It would be nice to have it in Vite as well.
Alternative
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.