grunt-spritesmith configuration is not working correctly on gruntfile.js

孤人 提交于 2019-12-11 12:56:46

问题


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'
    }
},

and this is my result but the verbosed message is not the best to understand what's going wrong.

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

What can it be?


回答1:


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 }
    }
},


来源:https://stackoverflow.com/questions/21047162/grunt-spritesmith-configuration-is-not-working-correctly-on-gruntfile-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!