我刚刚将 grunt spritesheet 安装到我的 Windows 系统上,当我尝试运行该包时,我收到此任务的错误:"grunt.spritesheet requires a sprites and sheet property"。
包看起来正确加载,并与 grunt 一起运行所有其他任务。我也加载了 Python2.7 和 Cairo 依赖项。
在我的主要 gruntfile(已经有 require、jshint 和 compass 运行良好)中,我添加了:
spritesheet: {
// An array of filename / source images array pairs. The basename of the sprite file
// is also prefixed to the CSS classes.
sprites: {
"images/icons/sprite.png": ['images/icons/*.png']
},
// The destination for the build stylesheet
sheet: "scss/homepsprite.css"
}
所以,属性“sprites”和“sheet”显然是存在的。还有什么我想念的吗?该软件包与其他 grunt 模块一起加载良好...我有
grunt.loadNpmTasks('grunt-spritesheet');
在我的 gruntfile 以及
grunt.registerTask("default", ["jshint", "requirejs:dev", "compass:dev", "spritesheet"]);
感谢您的任何反馈。