Skip to content

Instantly share code, notes, and snippets.

@Belyash
Last active October 24, 2015 23:05
Show Gist options
  • Save Belyash/e2dd8414ce8019624c31 to your computer and use it in GitHub Desktop.
Save Belyash/e2dd8414ce8019624c31 to your computer and use it in GitHub Desktop.
Пример игнорирования сборки шаблонов для включаемых кусков (как _name.scss в SASS)
module.exports = function(grunt) {
// Предположим, что имеем такую иерархию в проекте:
// /views
// -> /includes/
// -> head.jade
// -> foot.jade
// -> /layouts/
// -> post.jade
// -> archive.jade
// -> 404.jade
// -> index.jade
// -> category-archive.jade
// -> tag-archive.jade
grunt.initConfig({
jade: {
files: [ {
cwd: "views",
dest: "build",
expand: true,
ext: ".html",
// Ignore directories with including parts like head.jade, foot.jade and layouts
src: ["**/*.jade", '!**/includes/**', '!**/layouts/**']
} ]
},
watch: {
jade: {
files: ['views/**/*.jade'],
tasks: ['jade']
}
}
});
grunt.loadNpmTasks('grunt-contrib-jade');
grunt.loadNpmTasks('grunt-contrib-watch');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment