Closed ghost closed 8 years ago
first run:
(sudo) npm install grunt-contrib-watch --save-dev
than include watch in your Gruntfile.js
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: {
compile: ['app/views/**/*.phtml'],
},
jade4php: {
compile: {
options: {
pretty: true
},
expand: true,
cwd: 'jade',
src: ['**/*.jade', '!_**/*.jade', '!layout/*.jade', '!mixins/*.jade', '!includes/*.jade'],
dest: 'htdocs/templates/',
ext: '.phtml'
}
},
watch: {
jade: {
files: ['**/*.jade'],
tasks: ['jade4php'],
}
}
});
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-jade4php');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['clean','jade4php']);
};
activate watch
grunt watch
update: change
dest: 'htdocs/templates/',
Hello there,
how can I watch this jade4php code: