#define ATOMIC_FS_UPDATE
included as described in https://arduino-esp8266.readthedocs.io/en/latest/ota_updates/readme.html#compression.
I use a "Generic EPS8266 module" with setting "Flash size = 4MB (FS:2MB OTA:~1019KB)".
I created the SPIFFS image .bin file with
%sketchdir%\mkspiffs.exe --size 0x1FA000 --page 256 --block 8192 -d 5 --create %sketchdir%\data %sketchdir%\spiffs.file.bin
%gzip% a -tgzip -mx9 %sketchdir%\spiffs.file.bin.gz %sketchdir%\spiffs.file.bin
where %sketchdir% is the sketch folder (I copied mkspiffs.exe there for convenience) and %gzip% points to 7z.exe on my machine.
I based my sketch upon https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266HTTPUpdateServer/examples/SecureWebUpdater. When I connect to it, and go to the update folder, I see four buttons. I select the spiffs.file.bin.gz file with the FileSystem button, and press "Update FileSystem". Then I wait, until the confirmation comes that it was successful. I reboot, but then the FS is empty. While if I upload the non-compressed file spiffs.file.bin, the filesystem contains the desired files correctly.
According to https://arduino-esp8266.readthedocs.io/en/latest/ota_updates/readme.html#compression this should work when I define ATOMIC_FS_UPDATE. However, I cannot find an example anywhere of a sketch that includes this option.