I'm having this following problem, "clean" does not work. (It only worked the first time, as I show in the picture) He is not erasing the folder, I would like to understand what is happening. Thank you
"use strict";
module.exports = function(grunt) {
const buildPath = "_site/";
const hoganPath = buildPath + "libs/hogan";
var config;
config = {
copy: {
main: {
files: [
{expand: true, src: ['index.html'], dest: buildPath},
{expand: true, cwd: 'assets/', src: ['**'], dest: buildPath},
{expand: true, cwd: 'node_modules/hogan.js/lib/', src: ['template.js'], dest: hoganPath},
]
}
},
hogan: {
template: {
src : 'mytemplate.hjs',
dest : buildPath + 'js/mytemplate.js',
options : { binderName: 'hulk' }
}
},
watch: {
scripts: {
files: ['**/*.hjs', 'index.html', 'assets/js/*.js', 'assets/css/*.css'],
tasks: ['clean', 'copy', 'hogan'],
},
},
clean: [buildPath]
};
//Init Grunt
grunt.initConfig(config);
// Load Tasks
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-hogan');
//Register Task
grunt.registerTask('default', ['clean', 'copy', 'hogan', 'watch']);
};