简体   繁体   中英

Loading“Gruntfile.js”tasks…ERROR

'use strict';

module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);

require('time-grunt')(grunt);

var config = {
    app:'app',
    dist:'dist'
}

grunt.initConfig({
    config: config,

    copy: {
        dist_html: {
            src:'<%= config.app %>/index.html',
            dest:'<%= config.dist %>/index.html'
        },
        dist_js: {
            src:'<%= config.app %>/js/index.js',
            dest:'<%= config.dist %>/js/index.js'
        }
    },

    clean: {
        dist: {
            src: '<%= config.dist %>/index.html'
        }
    }
});}}

cmd picture I input “grunt copy”in cmd,but it error.I started to learn grunt soon,How can I solve this problem?I need help,thinks.

You need to register the task to be able to use it in cmd.

For example:

grunt.registerTask(taskName, [description, ] taskFunction)

you only have configured what pathes to use you should create a task like so:

grunt.task({
 // Do Stuff here
})

There is more information on grunt tasks here: http://gruntjs.com/api/grunt.task

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM