Sorry, I’ve found the problem… the filename of the image
change spiffs.bin to littlefs.bin did the trick. The script its working now
env.AddPreAction( '$BUILD_DIR/spiffs.bin', gzip_webfiles )
to
env.AddPreAction( '$BUILD_DIR/littlefs.bin', gzip_webfiles )