Last active
May 6, 2016 14:35
-
-
Save daveroma/754d53a65b87bf8914f2887e17d532f0 to your computer and use it in GitHub Desktop.
Use Grunt to compile pug files into html
This file contains 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) { | |
grunt.initConfig({ | |
pug: { | |
compile: { | |
options: { | |
pretty: true, | |
data: { | |
debug: false | |
} | |
}, | |
files: [ { | |
cwd: "templates", | |
src: ['**/*.pug', '!includes/*', '!layout.pug'], | |
dest: "public", | |
expand: true, | |
ext: ".html" | |
} ] | |
} | |
}, | |
watch: { | |
templates: { | |
files: ['templates/**/*.pug'], // which files to watch | |
tasks: ['pug'], | |
options: { | |
nospawn: true | |
} | |
} | |
} | |
}); | |
grunt.loadNpmTasks('grunt-contrib-pug'); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
grunt.registerTask('default', ['watch']); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment