汇总输出自定义JSON文件

时间:2020-10-29 01:05:54

标签: svelte rollupjs

我正在从Svelte项目构建Adobe UXP插件,并且需要生成自定义JSON清单文件。

理想情况下,这将从应用程序的package.json中获取一些JSON数据(例如名称和版本),并以特定格式添加一些默认值。

例如:

package.json

  "name": "svelte-app",
  "version": "1.0.0",
  "scripts": {
    },
  "devDependencies": {
    },
  "dependencies": {
  }
}

将生成以下内容:

public / build / manifest.json

{
  "id": "*******",
  "name": "svelte-app",
  "version": "1.0.0",
  "main": "index.html",
  "host": [
    {
      "app": "PS",
      "minVersion": "22.0.0"
    }
  ],
  "manifestVersion": 4,
  "entrypoints": [
    {
      "type": "panel",
      "id": "vanilla",
      "minimumSize": {
        "width": 230,
        "height": 200
      },
      "maximumSize": {
        "width": 2000,
        "height": 2000
      },
      "preferredDockedSize": {
        "width": 230,
        "height": 300
      },
      "preferredFloatingSize": {
        "width": 230,
        "height": 300
      },
      "label": {
        "default": "svelte-app"
      }
    }
  ],
  "icons": [
    {
      "width": 23,
      "height": 23,
      "path": "icons/dark.png",
      "scale": [
        1,
        2
      ],
      "theme": [
        "darkest",
        "dark",
        "medium"
      ]
    },
    {
      "width": 23,
      "height": 23,
      "path": "icons/light.png",
      "scale": [
        1,
        2
      ],
      "theme": [
        "lightest",
        "light"
      ]
    }
  ]
}

0 个答案:

没有答案