新的咕哝警告:任务;concat,uglify“;找不到
new to grunt - warning: task "concat, uglify" not found
正如标题所说,我是Grunt的新手。我正在学习位于以下位置的教程:http://24ways.org/2013/grunt-is-not-weird-and-hard/.这是一个较老的教程,但大多数似乎都是一样的。我安装了"grunt contrib concat"answers"grunt contrib uglify",可以分别运行。但当我运行grunt
时,我会得到以下错误:Warning: Task "concat, uglify" not found. Use --force to continue. Aborted due to errors.
我一直在四处寻找,似乎找不出来。我的文件如下:
Gruntfile.js:
module.exports = function(grunt) {
// 1. All configuration goes here
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
dist: {
src: [
'js/libs/*.js', // All JS in the libs folder
'js/controls.js', // This specific file
],
dest: 'dist/built.js',
}
},
uglify: {
build: {
src: 'js/build/production.js',
dest: 'js/build/production.min.js',
}
},
});
// 3. Where we tell Grunt we plan to use this plug-in.
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
// 4. Where we tell Grunt what to do when we type 'grunt' into the terminal.
grunt.registerTask('default', ['concat, uglify']);
};
package.json:
{
"name": "grunt_libsass_example-project",
"version": "0.1.0",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-concat": "^0.5.1",
"grunt-contrib-uglify": "^0.9.1"
}
}
您只为registerTask任务列表传入一个字符串。它应该是一个包含字符串列表的数组,如:
grunt.registerTask('default', ['concat', 'uglify']);
你得到这个错误是因为它正在寻找一个名为"concat,uglify"的任务。
我必须运行:
npm install grunt-contrib-uglify --save-dev
相关文章:
- 气质的“nestRemoting()”有时可以'找不到关系
- 错误405:向Java控制器(Ajax)发送JSON时找不到POST方法
- 找不到模块捆绑包
- for循环中的javascript if语句找不到==
- 为什么JavaScript可以'找不到给定的InnerHTML并返回Cannot set property
- 失败:等待Protractor与页面同步时出错:“”;在窗口上找不到角度”;
- Babel编译错误:找不到模块核心js/library/fn/get迭代器
- [Vue warn]:找不到元素
- ngRoute找不到模板
- 未能加载,因为找不到支持的源.当播放HTML5音频元素时
- 因果报应-找不到模块:错误:无法解析模块'scs'
- Angular 2:在本地.json文件上找不到文件
- module.js在运行iron节点时找不到模块
- 放大弹出生成“;找不到文件”;YouTube视频的错误
- 我发现了一些只在移动设备上可见的垃圾邮件链接,我可以'找不到包含此垃圾邮件链接的脚本的位置
- Web 地址虚拟目录会断开外部 JavaScript 链接,因此找不到文件
- Meteor.js可以'找不到语义:ui包
- 找不到容器:goog.Disposable.instances _在为javascript工具使用泄漏查找器时出错
- 新的咕哝警告:任务;concat,uglify“;找不到
- Grunt警告:任务;concat”;找不到