To do that, one should create extra_script.py at the same level as platformio.ini and put some code in it.
Code: Select all
# custom action before building SPIFFS image. For example, compress HTML, etc.
env.AddPreAction("$BUILD_DIR/spiffs.bin", callback...)
1. favicon.ico
2. index.html
I wonder how my extra script code should look like if I want to have the following file structure on the SPIFFS partition after uploading an image:
1. favicon.ico
2. index.html.gz
I'm using W10, VSCode with platformio 4 addon for writing, building and uploading OTA firmware and partition images, if it's important.