我的grunt没有任何输出,我刚刚安装了整个系统、NPM和grunt-cli。当我输入“grunt -v”时,没有任何返回结果。 这是我的package.json:
{
"name": "project",
"version": "2.0.0",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-coffee": "~0.7.0",
"grunt-contrib-compass": "~0.6.0",
"grunt-contrib-uglify": "~0.2.2",
"grunt-contrib-watch": "~0.5.3",
"grunt-yui-compressor": "~0.3.0",
"grunt-contrib-cssmin": "~0.7.0"
}
}
我的 Gruntfile.coffee 是:
module.exports = (grunt) ->
# Project configuration.
grunt.initConfig
pkg: grunt.file.readJSON("package.json")
coffee:
glob_to_multiple:
expand: true
flatten: true
src: ['assets/javascripts/source/*.coffee']
dest: 'assets/javascripts/build/'
ext: '.js'
compass:
dev:
options:
config: 'config.rb'
cssmin:
add_banner:
options:
banner: '/* Compilado em ' + grunt.template.today('dd/mm/yyyy') + ' */'
files:
'assets/styles/build/site.min.css': ['assets/styles/build/site.css']
'assets/styles/build/site-ie7.min.css': ['assets/styles/build/site-ie7.css']
uglify:
dev:
files:
'assets/javascripts/build/scripts.min.js':[
'assets/javascripts/build/scripts.js'
'assets/javascripts/build/zt-validator.js'
'assets/javascripts/build/jquery-zt.js'
]
dist:
files:
'assets/javascripts/build/scripts-full.min.js':[
'assets/javascripts/build/scripts.js'
'assets/javascripts/build/zt-validator.js'
'assets/javascripts/build/jquery-zt.js'
'assets/javascripts/build/site.js'
]
watch:
options: { spawn: false }
coffee:
files: ["assets/javascripts/source/*.coffee"]
tasks: ["coffee","uglify"]
compass:
files: ["assets/styles/**/*.sass","assets/styles/**/*.scss"]
tasks: ["compass","cssmin"]
grunt.loadNpmTasks "grunt-contrib-coffee"
grunt.loadNpmTasks "grunt-contrib-watch"
grunt.loadNpmTasks "grunt-contrib-compass"
grunt.loadNpmTasks "grunt-contrib-cssmin"
grunt.loadNpmTasks "grunt-contrib-uglify"
# Default task(s).
grunt.registerTask "default", ["coffee", "compass"]
我不知道如何调试它。
grunt -v
将以详细模式运行默认任务。那么你的Gruntfile.js
中的默认任务是什么? - Matthew Bakaitisgrunt -V
中大写的 'V' 显示版本,小写的 'v' 设置详细模式...无论哪种方式,问题是grunt
没有采取任何行动吗?还是只是没有打印版本? - Matthew Bakaitis