WeFlow ??? ??
/ Reversion 解決方案
Reversion 解決方案
在前端開發(fā)的工作當(dāng)中,我們不止一次遇到靜態(tài)資源的更新問題,為了更好的利用緩存,我們一般都會(huì)將靜態(tài)資源的過期時(shí)間設(shè)得很長,為了加載速度更快,我們甚至用了 CDN,那么,當(dāng)我們想更新一個(gè)已上線的資源時(shí),就會(huì)遇到因?yàn)榫彺娑聼o法及時(shí)的問題。
基于這個(gè)問題,tmt-workflow
直接提供一套 reversion 的解決方案。
開啟方式:
1. 打開 .tmtworkflowrc
配置文件,作如下配置:
{ "reversion": true}
2. 執(zhí)行 gulp build_dist
即可
tmt-workflow
會(huì)根據(jù)你的每次修改,根據(jù)內(nèi)容生成相應(yīng)的 md5,并更新樣式文件和 html 文件等所有引用的資源,你只需將其直接上傳即可,勿需其他額外操作,文件的 manifest.json 文件如下:
{ "css/style-index.css": "css/style-index.e72b382a.css", "html/index.html": "html/index.html", "img/bg-body.png": "img/bg-body.131a8d26.png", "img/bg-logo.png": "img/bg-logo.dda3116e.png", "sprite/style-index.png": "sprite/style-index.0e41255a.png", "sprite/style-index@2x.png": "sprite/style-index@2x.2eaf5fed.png" }
html 文件不作 reversion, 如果有需要,自行更改一下代碼即可。