Reversion solution
In the work of front-end development, we have encountered the problem of updating static resources more than once. In order to make better use of cache, we usually set the expiration time of static resources to a long time in order to load faster. , we even use CDN, then when we want to update an online resource, we will encounter the problem that the update cannot be timely due to caching.
Based on this problem, tmt-workflow
directly provides a set of reversion solutions.
Opening method:
1. Open the .tmtworkflowrc
configuration file and make the following configuration:
{ "reversion": true}
2. Execute gulp build_dist
and
tmt-workflow
will generate the corresponding md5 based on the content according to each modification you make, and update the style file and html files and other referenced resources, you only need to upload them directly without any additional operations. The manifest.json file of the file is as follows:
{ "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 The file will not be reversioned, if necessary , just change the code yourself.