vite_ruby
vite_ruby copied to clipboard
Massive log dump in UAT environment when entrypoint is missing
- [x] I have tried upgrading by running
bundle update vite_ruby. - [x] I have read the troubleshooting section before opening an issue.
Description 📖
When an entrypoint that is included with vite_typescript_tag is missing, vite_ruby dumps the whole Vite config, build status, manifest etc, which can be helpful in development. In our case though, it is over 1 million lines worth (because the manifest JSON is pretty printed).
We noticed that it does this in UAT/staging, causing 1mil log lines to be saved to uat.log/staging.log, which then gets picked up and sent to our logging service in the space of 1 minute.
We need a way to turn off this debug dump in production/uat/staging environments, but there doesn't not seem to be any way to do so currently.
Relavant bits:
- https://github.com/ElMassimo/vite_ruby/blob/d4bd2efe4194e40a1cb32d1f0c8efd8a1980db9c/vite_ruby/lib/vite_ruby/manifest.rb#L78-L80
- https://github.com/ElMassimo/vite_ruby/blob/d4bd2efe4194e40a1cb32d1f0c8efd8a1980db9c/vite_ruby/lib/vite_ruby/manifest.rb#L216-L223
- https://github.com/ElMassimo/vite_ruby/blob/main/vite_ruby/lib/vite_ruby/missing_entrypoint_error.rb
No config options to turn this off or to minimize the output.