Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update Jade file css, js references by grunt-usemin

My app uses a jade templates which is served by NodeJS express framework. It uses grunt to build the front end. I found that grunt-usemin creates grunt configurations for tasks such as uglify, concat, cssmin and requirejs and it also updates the css, js references in the end.

The grunt-usemin works very well with HTML files. I also found that grunt-contrib-jade plugin useful when we compiles jade to html. But I do not want to compile jade to HTML files.

How can i use grunt-usemin with jade templates or any other solutions to do it?

like image 364
Fizer Khan Avatar asked Sep 15 '13 11:09

Fizer Khan


1 Answers

You could use usemin-patterns

usemin: {
    jade: 'src/views/**/*.jade',
    options: {
        assetsDirs: ['public'],
        patterns: {
            jade: require('usemin-patterns').jade
        }
    }
}
like image 130
bevacqua Avatar answered Oct 13 '22 17:10

bevacqua