Hi,
When building the FS image, files are collected from the data/ directory.
But I’m building some of them before building the filesystem itself (templating, HTML, CSS etc) and I would like to exclude “source” files from the FS build.
I tried adding src_filter = -<*.slim> in my platformio.ini for .slim files are still added.
This only affects C/C++/ASM source files for the firmware, not the filesystem. PlatformIO has no filter option for the filesystem build. Every file that is in the data/ directory (or more generally $PROJECT_DATA_DIR) at the point the DataToBin builder is executed will be included in the filesystem. See source and source.
or, use advanced scripting and a Pre action to the littefs.bin / spiffs.bin build in which you move all non-wanted files out of the data/ directory before the conversion is done, and back in after the conversion is done (Post action). See documentation.