Skip to content

Instantly share code, notes, and snippets.

@daveroma
Last active May 6, 2016 14:35
Show Gist options
  • Save daveroma/754d53a65b87bf8914f2887e17d532f0 to your computer and use it in GitHub Desktop.
Save daveroma/754d53a65b87bf8914f2887e17d532f0 to your computer and use it in GitHub Desktop.
Use Grunt to compile pug files into html
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