You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and
16
16
- The processing of a specific image will now be skipped if the originDensity specified does not equal the maxDensity value available for that image in the metadata file.
17
17
- The processing of a specific image will now be skipped if the target formats specified do not match those available in the metadata file for that image.
18
18
- The breakpoint suffix in raster image file names must now begin with `~` instead of `-`. For example, `cat-768.png` must be renamed to `cat~768.png`.
19
+
- The `-m` (`--add-meta-data`) flag is now enabled by default. Use `--no-m` (`--no-add-meta-data`) to disable it.
19
20
- The name of the JSON metadata file now has the suffix `.meta`.
20
21
- The name of the JS metadata file now has the suffix `.imports`.
21
22
- The JS metadata file now exports only an array with dynamic imports.
Copy file name to clipboardExpand all lines: README.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -102,19 +102,19 @@ Optimize is invoked via the command line:
102
102
103
103
#### `-m`, `--add-meta-data`
104
104
105
-
-_Default:_`false`
105
+
-_Default:_`true`
106
106
-_Description:_ Create JSON and JS files with metadata of the raster images and CSS file for the icons
107
107
108
-
> #### Note: Don’t forget to specify the `-m` flag
108
+
> #### Tip: Canceling the addition of metadata files
109
109
>
110
-
> When processing raster images, the `-m` flag (`--add-meta-data`) enables the generation of metadata files. Metadata files are useful for generating the `picture` tag. JS files are needed in Vite-based frameworks (such as Astro) because their dynamic imports during project build return paths to hashed files. And using custom properties from the CSS icon file allows you to automatically encode icons into styles.
110
+
> Metadata files are useful for generating the `picture` tag. JS files are needed in Vite-based frameworks (such as Astro) because their dynamic imports during project build return paths to hashed files. And using custom properties from the CSS icon file allows you to automatically encode icons into styles. To cancel the addition of metadata files, use the `--no-` prefix for the flag: `--no-m` or `--no-add-meta-data`.
111
111
112
112
### Examples
113
113
114
-
- In the `source/images` folder, optimize all SVGs and convert the raster images to `avif` and `webp` formats at the original size for `2x` pixel density and at a reduced size for `1x` pixel density; and after processing the raster images, delete their original files and generate JSON and JS files with metadata:
114
+
- In the `source/images` folder, optimize all SVGs and convert the raster images to `avif` and `webp` formats at the original size for `2x` pixel density and at a reduced size for `1x` pixel density; and after processing the raster images, delete their original files and not generate JSON and JS files with metadata:
> #### Tip for exporting raster layers from layouts
@@ -124,13 +124,13 @@ Optimize is invoked via the command line:
124
124
- Take all vector and raster images from the `raws/images` folder; optimize vector images and put them in `source/images`; convert raster images to `webp` format and to the original format, optimizing them for `2x` and `1x` pixel densities, placing these results also in `source/images`; when processing is completed, delete the original raster images from `raws/images`:
125
125
126
126
```shell
127
-
optimize images -i raws/images -o source/images -f webp -a -r
0 commit comments