paulyoung / jade-inheritance

Reduce compilation time for Jade files by understanding inheritance.
MIT License
40 stars 13 forks source link

Dest folder #8

Closed sshmyg closed 10 years ago

sshmyg commented 10 years ago

Hello. There is any solution, to put all builded files into one folder, without subfolders as jade templates structured?

sshmyg commented 10 years ago

Solved. Solution: http://screencast.com/t/1CSqgQOxo

jade : {
            compile: {
                options:{
                    basedir : '<%= loc.jade %>',
                    pretty  : true,
                    client  : false,
                    data    : grunt.file.readJSON(pathJade)
                },
                files: [{
                    src : [
                        '{,basedir/}**/*.jade',
                        '!{,basedir/}*.jade',
                        '!{,basedir/}mixin/**/*.jade',
                        '!{,basedir/}var/**/*.jade',
                        '!{,basedir/}exten/**/*.jade',
                        '!{,basedir/}array/**/*.jade',
                        '!{,basedir/}temp/include/**/*.jade'
                    ],
                    dest    : '<%= loc.markup %>',
                    cwd     : '<%= loc.jade %>',
                    expand  : true,
                    ext     : '.html',
                    rename: function(destBase, destPath) {
                        var index = destPath.lastIndexOf('/');
                        if (index !== -1 && destPath.slice) {
                            destPath = destPath.slice(index + 1, destPath.length);
                        }
                        return destBase + '/' + destPath.replace(/\.jade$/, '.html');
                    }
                }]
            }
        },