grunt-filerev with grunt-usemin on smarty template files are not updating asset references

156 Views Asked by At

I have many projects working with grunt asset management on html files but with a new project using smarty templating the *.tpl file is updated i.e. concatenating .css files but it refuses to update grunt-filerev changes.

Could someone please point out what is wrong in my setup?

Structure

    app
        DetailViewBlockView.tpl
        css
            promarketing.c61e8a7b.css
    dev
        DetailViewBlockView.tpl
        css
            promarketing.css
node_modules
gruntfile.js
package.json
package-lock.json

.tpl File

<!-- build:css css/promarketing.css -->
    <link rel="stylesheet" type="text/css" href="./css/promarketing.css" media="screen">
<!-- endbuild -->  

gruntfile.js module.exports = function (grunt) {

  require('load-grunt-tasks')(grunt);

  grunt.initConfig({


    // Filerev all images
    filerev: {
      options: {
        algorithm: 'md5',
        length: 8
      },
      build: { 
            src: 'dev/css/promarketing.css',
            dest: 'app/css/'
          }
    },
    useminPrepare: {
        html: 'app/DetailViewBlockView.tpl',
        options: {
            dest: 'app'
        }
    },
    usemin:{
      html:['app/DetailViewBlockView.tpl']
    },
        options: {
            dirs: ['app']
        }
  });

  grunt.registerTask('default', ['useminPrepare','filerev','usemin']);
};
0

There are 0 best solutions below