我的 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"]
我不知道如何调试它。