Open svoop opened 8 months ago
I did some research on this, unfortunately, there doesn't seem to be any way to ignore certain files or directories using esbuildOptions
. Maybe marking those files as external
in order not to bundle them could work, but currently this mechanism is used for all assets but those in css/
and js/
. This might change with #24 though.
Otherwise, the only alternative would be the removal of those .DS_Store
files prior to the run. That's certainly too invasive to be built into Hanami and would have to be done hooking in some code into assets.js
or even by sweeping them manually before compiling the assets.
I'll reach out to the esbuild community to see what they'd suggest.
On macOS filesystems (HFS and APFS), finder metadata is written to
.DS_Store
which causes loads of fun in many places. Other filesystems might have similar reserved metadata files as well, but I'm not aware of any since the only other filesystem I'm really familiar with is ext on Linux.When building the assets on macOS, these
.DS_Store
directories are processed as well:And as a consequence, they also show up in the
assets.json
manifest:If the assets are compiled during development and not during deployment (maybe not a common scenario, but certainly not impossible) or when deploying to such a filesystem, this finder metadata is exposed to the public. There might not be critical information in there, but
.DS_Store
is a black box and who knows what Apple decides to persist there in the future.Maybe, there should be a short denylist with known files like
.DS_Store
which should never be processed.