我在一个Jekyll网站上使用咕噜应答-图像。
一个相关的问题 on GitHub现在已经关闭,但是我仍然会看到这个错误。src和cwd都指向单个test.jpg映像。
当我运行grunt responsive_images:posts时,无法编译;没有找到有效的源文件。
gruntfile的示例:
...
responsive_images: {
posts: {
options: {
engine: 'im',
sizes: [
{ name: 'small', width: 320, quality: 80 }
]
},
files: [
{
expand: true,
src: [ '_assets/posts/**{.jpg}' ],
cwd: '_assets/posts/',
dest: 'img/'
}
]
}
},
...Grunt依赖项:
{
"name": "corporate-programmer",
"version": "1.0.0",
"devDependencies": {
"bootstrap-sass": "^3.3.6",
"grunt": "^1.0.1",
"grunt-concurrent": "^2.3.0",
"grunt-contrib-clean": "^1.0.0",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-sass": "^1.0.0",
"grunt-contrib-watch": "^1.0.0",
"grunt-responsive-images": "^0.1.7",
"grunt-shell": "^1.3.0",
"load-grunt-tasks": "^3.5.0"
}
}文件结构示例:

详细输出:

> npm -v
> 2.7.4
> npm list imagemagick -g
> └── imagemagick@0.1.3发布于 2016-04-29 18:30:36
src通常相对于cwd中定义的路径,将src值更新为**/*.js
responsive_images: {
posts: {
options: {
engine: 'im',
sizes: [
{ name: 'small', width: 320, quality: 80 }
]
},
files: [
{
expand: true,
src: [ '**/*.jpg' ],
cwd: '_assets/posts/',
dest: 'img/'
}
]
}
},https://stackoverflow.com/questions/36945133
复制相似问题