Fixed asset revving issue with css files

This commit is contained in:
Torkel Ödegaard
2015-03-13 11:11:31 +01:00
parent ab307ec7f3
commit 4b3224702c
10 changed files with 46 additions and 167 deletions
+20
View File
@@ -19,11 +19,31 @@ module.exports = function(grunt) {
'requirejs:build',
'concat:js',
'filerev',
'remapFilerev',
'usemin',
'clean:temp',
'uglify:dest'
]);
// task to add [[.AppSubUrl]] to reved path
grunt.registerTask('remapFilerev', function(){
var root = grunt.config().destDir;
var summary = grunt.filerev.summary;
var fixed = {};
for(var key in summary){
if(summary.hasOwnProperty(key)){
var orig = key.replace(root, root+'/[[.AppSubUrl]]');
var revved = summary[key].replace(root, root+'/[[.AppSubUrl]]');
fixed[orig] = revved;
}
}
grunt.filerev.summary = fixed;
});
grunt.registerTask('build-post-process', function() {
grunt.config('copy.dist_to_tmp', {
expand: true,