我遇到以下问题,“干净”不起作用。 (它只是第一次工作,正如我在图片中所示)他没有删除文件夹,我想了解发生了什么。感谢
"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']);
};