gulp


gulp.spritesmith can't find retina images when in a subdirectory


I've been trying to get gulp.spritesmith working with retina images but with not luck.
As long as my images are at the same level as the gulp file, everything works as expected. If I move my images to a subdirectory and change the gulp.src to point to it, I get the following error:
AssertionError: Retina settings detected but 0 retina images were found. We have 2 normal images and expect these numbers to line up. Please double check `retinaSrcFilter`.
Here's the setup I've got:
gulp.task('sprite', function () {
var spriteData = gulp.src('img/*.png')
.pipe(spritesmith({
retinaSrcFilter: '*#2x.png',
imgName: 'spritesheet.png',
retinaImgName: 'spritesheet#2x.png',
cssName: 'sprites.scss'
}));
return spriteData.pipe(gulp.dest('dist/'));
});
Again, if I change the src to be
var spriteData = gulp.src('*.png')
and have the same images there, everything is fine.
Does anyone know what could be the issue here?
Thanks.
I think you might need the dir in the retinaSrcFilter glob too?
gulp.task('sprite', function () {
var spriteData = gulp.src('img/*.png')
.pipe(spritesmith({
retinaSrcFilter: 'img/*#2x.png',
imgName: 'spritesheet.png',
retinaImgName: 'spritesheet#2x.png',
cssName: 'sprites.scss'
}));
return spriteData.pipe(gulp.dest('dist/'));
});

Related Links

Gulp loops for generate sprite by folder
Pass Parameter to Gulp Task
My default gulp task is not executing other tasks
Gulp Browserify SourceMaps
What is the purpose(s) of JavaScript build tools
gulp-jshint utters errors when using browserify
Gulp “watch” is not running the sub task “sass” on file change
Proxy URL not working with BrowserSync Gulp task
the task can't be called by watch module.
I can't get the data-uri() function to work on gulp.js to base64 an image on mac
How to inject bower dependencies in karma.conf.js file with gulp?
Getting Libsass Gulp Susy to work together
Gulp compass without config.rb
gulp-webserver: Default to index.html if available, else show directories
gulp-uglify notify on failing build
Declaring optional dependencies

Categories

HOME
gcc
kendo-ui-angular2
optimization
macros
stanford-nlp
intellij-idea
grpc
file-upload
nltk
mingw
thermal-printer
powerquery
docker-compose
cdn
rmarkdown
ejb-3.0
dcos
rename
minimax
mongoimport
jpql
velocity
vichuploaderbundle
resharper
fine-uploader
background-image
openscad
serenity-js
include-path
typedef
tcpdf
pushbullet
drombler-fx
scripting-language
sqldependency
git-submodules
spock
schedule
intermec
textview
blockly
slim-lang
oracle-nosql
apache-falcon
http-proxy
tunnel
wit-ai
minitest
kofax
ng-lightning
collation
wufoo
piranha-cms
niagara-ax
weld
anonymous-function
denodo
ng-class
sp
dmalloc
chain
spring-social-twitter
zsh-completion
mavlink
symantec
eclipse-mars
joystick
require-handlebars
particle-system
magick.net
qtruby
diameter-protocol
periodic-processing
wordpress-plugin
app-data
angular-promise
database-project
self-join
dnvm
borland-c++
system.diagnostics
veeam
strcpy
qxorm
information-hiding
qf-test
grunt-contrib-imagemin
google-oauth-java-client
mencoder
pechkin
ironworker
playing-cards
record-locking
ntdll
rbm
gpl
optimistic-concurrency
datejs
visual-leak-detector
backlight
funambol
dgml
lts
focus-stealing
urlscan
memory-consumption

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App