Last active
February 16, 2017 01:10
-
-
Save juanpablocs/3247ade3ddb360351366758845642829 to your computer and use it in GitHub Desktop.
replace static file and add timestamp for cached in layout html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sed -ri \"s/myjs\.js([^\"]+|)\"/min.js?$(date +%s)\"/g" ./mylayout.twig | |
#replace this | |
<script src="/myjs.js"></script> | |
or | |
<script src="/myjs.js?1487206735"></script> | |
with this | |
<script src="/myjs.js?2348392493284932"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "My Site", | |
"version": "1.0.0", | |
"description": "test", | |
"scripts": { | |
"js":"NODE_ENV=production webpack -p", | |
"postjs":"sed -ri \"s/myjs\\.js([^\\\"]+|)\\\"/myjs.js?$(date +%s)\\\"/g\" ./mylayout.twig", | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment