使用干净,资源繁忙或锁定

时间:2018-04-06 23:40:38

标签: javascript gruntjs

我遇到以下问题,“干净”不起作用。 (它只是第一次工作,正如我在图片中所示)他没有删除文件夹,我想了解发生了什么。感谢

Node console Error

"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']);

};

0 个答案:

没有答案