json 文件中的西兰花资产 rev 指纹 url
Broccoli asset rev fingerprint urls in json file
我的 rails 应用程序和 index.html
文件托管在 heroku 上,其余资产在 s3 上,需要一个 manifest.json
文件才能启用移动网络chrome 在 android 上的应用程序模式看起来像:
{
"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
扩展名包含在可指纹文件列表中。
实际文件被指纹识别,但 "src": "launcher-icon-3x.png"
等内容没有。
无论如何都要这样做,还是我需要制作一个 in-Repo 插件来处理文件的创建?
查看 source 后,可以通过将 json
添加到 replaceExtensions 选项来完成以下操作:
var app = new EmberApp({
fingerprint: {
prepend: fingerprint,
extensions: ['js', 'css', 'png', 'jpg', 'gif', 'svg', 'json'],
replaceExtensions: ['html', 'css', 'js', 'json']
}
});
我的 rails 应用程序和 index.html
文件托管在 heroku 上,其余资产在 s3 上,需要一个 manifest.json
文件才能启用移动网络chrome 在 android 上的应用程序模式看起来像:
{
"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
扩展名包含在可指纹文件列表中。
实际文件被指纹识别,但 "src": "launcher-icon-3x.png"
等内容没有。
无论如何都要这样做,还是我需要制作一个 in-Repo 插件来处理文件的创建?
查看 source 后,可以通过将 json
添加到 replaceExtensions 选项来完成以下操作:
var app = new EmberApp({
fingerprint: {
prepend: fingerprint,
extensions: ['js', 'css', 'png', 'jpg', 'gif', 'svg', 'json'],
replaceExtensions: ['html', 'css', 'js', 'json']
}
});