slim icon indicating copy to clipboard operation
slim copied to clipboard

I want to know which files are being deleted when i using cmd `slim build`

Open AlberHwang422 opened this issue 2 years ago • 3 comments

I would like to know if there is a way to find out which files are being deleted during compression when using slim build to compress an image.

AlberHwang422 avatar Jun 09 '23 06:06 AlberHwang422

There's a "long" way to do it with the xray command. You can xray your original image and then you can xray the minified image, which will give you the information about the files in each image. and then you would subtract the file list of the minified image from the file list of your original image (will require a bit of jq magic to get the right data from the slim report json file).

There's an easy way using the Slim SaaS (totally free). You just need to make sure that both images are in a registry the SaaS can connect to. Then you use the "diff"/"compare" image option and you'll get a nice view that show's what's removed and what's still there.

kcq avatar Jun 09 '23 18:06 kcq

Hi, @kcq ,is there any report or log method for me to know what files has been detected when using slim build?

PerseidMeteor avatar Apr 17 '24 08:04 PerseidMeteor

@PerseidMeteor yes, the creport json file in the artifacts directory will give you that info. The console output will show you the artifacts directory where you'll find it. There's also a flag to copy it to your current directory or another location (--copy-meta-artifacts .) where you execute the build command.

You can also get a trace log of data events that's useful too. It's disabled by default. Use the --enable-mondel flag (you'll get a file called model.ndjson in the artifacts directory).

kcq avatar Apr 17 '24 22:04 kcq