grunt-spritesmith配置在gruntfile.js上无法正常工作 [英] grunt-spritesmith configuration is not working correctly on gruntfile.js

查看:156
本文介绍了grunt-spritesmith配置在gruntfile.js上无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 gruntfile.js 中,我为插件生成了精灵。
我必须说所有的配置都很好,spritesmith通过npm install来安装,插件是 package.json 中的一个依赖项。
,但还有其他的东西阻止了我的精灵命令的执行。

In my gruntfile.js I've this setup for my plugin for generating sprites. I've to say that everything is well configured, spritesmith is installed via npm install, the plugin is a dependency in the package.json. but there's something else blocking the execution of my sprite command

sprite:{
    dist: {
        src: ['css/theme/images/*.jpg'],
        destImg: 'css/theme/sprite/sprite.jpg',
        destCSS: 'css/theme/sprite/spritejpg.css'
    }
},

这是我的结果,但

C:\wamp\www\myproject>grunt sprite
Running "sprite:dist" (sprite) task
Fatal error: spawn ENOENT

它可能是什么?

推荐答案

在我的场景中,将这个属性添加到sprite配置中一切都解决了,默认的引擎配置不适合插件。 (当然,在我的机器ImageMagick已安装。

In my scenario, adding this attribute to the sprite configuration everything was solved, I guess the default engine configuration did not fit with the plugin. (of course in my machine ImageMagick is installed.

sprite:{
    dist: {
        src: ['css/theme/images/*.jpg'],
        destImg: 'css/theme/sprite/sprite.jpg',
        destCSS: 'css/theme/sprite/spritejpg.css',
        engineOpts: { 'imagemagick': true }
    }
},

这篇关于grunt-spritesmith配置在gruntfile.js上无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆