Is it possible to upload files to SPIFFS from a custom library

I have some code that I want to add to my own library. The code consists of both code as well as files (styleshets for a webserver) that should be uploaded to the ESP board when running pio run --target uploadfs from the project.

I have started with a plain project and everything works fine. I can’t figure out if the data directory can be moved to the library and if it is possible to load it to the esp when running the appropriate command.
Is this possible?

You could probably write an extra_script that copies any extra files from your library into the \data directory as a pre-uploadfs task?

https://docs.platformio.org/en/latest/projectconf/advanced_scripting.html

2 Likes

Interesting, will have do dig into that functionality :slight_smile: