Last active
October 24, 2015 23:05
-
-
Save Belyash/e2dd8414ce8019624c31 to your computer and use it in GitHub Desktop.
Пример игнорирования сборки шаблонов для включаемых кусков (как _name.scss в SASS)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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