JSPM

spritegen-png-cli

1.0.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 2
    • Score
      100M100P100Q24852F
    • License MIT

    从图标文件夹中生成Maplibre/Mapbox精灵图

    Package Exports

      This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (spritegen-png-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

      Readme

      spritegen-cli

      生成 MapLibre / Mapbox 兼容的精灵图(spritesheet)和元数据(json)。

      安装

      npm install -g spritegen-cli

      使用

      spritegen -i ./icons -o ./dist/sprite -n myicons --padding 2 --ratios 1,2 --scale2x

      参数说明

      • -i, --input 图标文件夹(默认 icons)
      • -o, --out 输出目录(默认 sprite)
      • -n, --name 精灵图文件基础名(默认 sprite)
      • -p, --padding 图标间距(默认 2px)
      • --ext 扩展名(默认 png,可 png,svg)
      • --ratios 生成的像素比(默认 1,可传 1,2)
      • --scale2x 无 2x 素材时,从 1x 放大生成
      • --watch 监听模式,自动重建