在json文件中的西兰花资产rev指纹URL

时间:2015-04-17 17:29:36

标签: ember-cli

我的rails应用程序和index.html文件托管在heroku上,其余资产都在s3上,有一个manifest.json文件是为了在android上启用Chrome的移动网络应用程序模式所必需的看起来像是:

{
  "short_name": "Kinlan's Amaze App",
  "name": "Kinlan's Amazing Application ++",
  "icons": [
    {
      "src": "launcher-icon-2x.png",
      "sizes": "96x96",
      "type": "image/png"
    },
    {
      "src": "launcher-icon-3x.png",
      "sizes": "144x144",
      "type": "image/png"
    },
    {
      "src": "launcher-icon-4x.png",
      "sizes": "192x192",
      "type": "image/png"
    }
  ],
  "start_url": "/index.html",
  "display": "standalone",
  "orientation": "landscape"
}

在我的brocfile.js我已将json扩展名包含在fingerprintable文件列表中。

实际文件会被指纹识别,但"src": "launcher-icon-3x.png"等内容却没有。

无论如何要做到这一点,还是我需要制作一个in-Repo插件来处理文件的创建?

1 个答案:

答案 0 :(得分:5)

查看source后,可以通过将json添加到replaceExtensions选项来完成以下操作:

var app = new EmberApp({
  fingerprint: {
    prepend: fingerprint,
    extensions: ['js', 'css', 'png', 'jpg', 'gif', 'svg', 'json'],
    replaceExtensions: ['html', 'css', 'js', 'json']
  }
});