Last active
August 29, 2015 14:17
-
-
Save thomasfr/ce99404a4fe4f0335242 to your computer and use it in GitHub Desktop.
Revisions
-
Thomas Fritz revised this gist
Mar 19, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ options: { patterns: [ { src: ['assets/js/**/*.js', 'assets/css/**/*.css',], search: /@@([^@]+?)@@/g, replace: function(matched, part, offset, string) { if(summary[part]) { return summary[part]; -
Thomas Fritz revised this gist
Mar 19, 2015 . 1 changed file with 15 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,11 @@ var summary = { '/js/custom/index.js' : '/js/custom/index.a67bcd.js', '/js/custom/facilitySearch.js' : '/js/custom/facilitySearch.k89han.js', '/img/foo/bar/eversport.png' : '/img/foo/bar/eversport.9iasdui.png', }; var search = /@@([^@]+?)@@/g; var htmlString = ` block append scripts script(src="@@/js/custom/index.js@@") <script src="@@/js/custom/boostrap.js@@"></script> @@ -13,11 +15,20 @@ var string = ` <script src="@@/js/custom/facilitySearch.js@@"></script> `; var cssString = ` body { background-image: url('@@/img/foo/bar/eversport.png@@'); } `; var replace = function(matched, part, offset, string) { if(summary[part]) { return summary[part]; } else { return part; } }; htmlString.replace(search, replace); cssString.replace(search, replace); -
Thomas Fritz created this gist
Mar 19, 2015 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ options: { patterns: [ { src: ['assets/js/**/*.js', 'assets/css/**/*.css',], match: /@@([^@]+?)@@/g, replace: function(matched, part, offset, string) { if(summary[part]) { return summary[part]; } else { return part; } } } ] } This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ var summary = { '/js/custom/index.js' : '/js/custom/index.a67bcd.js', '/js/custom/facilitySearch.js' : '/js/custom/facilitySearch.k89han.js', }; var match = /@@([^@]+?)@@/g; var string = ` block append scripts script(src="@@/js/custom/index.js@@") <script src="@@/js/custom/boostrap.js@@"></script> <p> <h1>Hallo Welt</h1> </p> <script src="@@/js/custom/facilitySearch.js@@"></script> `; string.replace(match, function(matched, part, offset, string) { if(summary[part]) { return summary[part]; } else { return part; } });