'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 我在cmd中输入“grunt copy”,但出现错误。我很快就开始学习grunt,我该如何解决这个问题?我需要帮助,我想。
最佳答案
您需要注册该任务才能在 cmd 中使用它。
例如:
grunt.registerTask(taskName, [description, ] taskFunction)
关于javascript - 正在加载“Gruntfile.js”任务...错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40383220/