Skip to content

Sketch.preview

This is an auxiliary module that allows to set or override some export settings specifically for the 'preview' mode. More…

Properties

Unique properties

The properties unique for this exporting mode (non-existing in Sketch.export) are marked below with bold font.

Detailed Description

This module, as well as the rest of auxiliary modules such as Sketch.layers, Sketch.artboards, and Sketch.pages, plays only a helping role. It allows to attach some properties to your products or groups that are later used by the rules defined in the main Sketch.export module.

Format

The output format for this exporting mode is always PNG.

File Tags

This module doesn't set or use any tags.

Property Documentation

maxSize

Maximum width/height of exported preview image.

If the property is not set, it is considered as no maximum.

Default: undefined

outputDir

If you set this property, the assets are exported to folder with this name relatively to workingDir. In other words, the resulting filename is prepended by outputDir/.

Default: undefined

outputFileName

Filename for saving a preview image.

If the property is not set, then the original filename is used with .preview.png suffix (e.g. assets.sketchassets.preview.png).

Default: undefined

overwrite

Set this to true to allow to overwrite existing files with newly generated once.

I couldn't make it work

I tried this parameter with the sketchtool, however, it had no influence. Maybe it doesn't work or maybe I did something wrong.

Default: false