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

Karma/jasmine testing error: “Uncaught TypeError: Unexpected anonymous System.register call.”
when I run (npm install gulp-msbuild) inside the Package Manager Console (VS2015), it throws warning
Gulp-kss issues
Browserify - accurate build log in terminal with o: --colors, silimar to webpack
Minimist not finding arguments
Gulp.js. Same task on watch, with different parallel tasks
Split css for different devices
Gulpfile not working when module.exports references a Gulp task not a function?
Use gulp to process bowser files
Getting an error when trying to serve the app using browser-sync
Can't Sprite using gulp.spritesmith
How can I make build variables available to all JS files in gulp?
Gulp not installed globally?
gulp-useref deep folders error
use gulp+browserify+reactify, can't emit exit when got a ReactifyError
gulp-browserstack and gulp-cucumber don't seem to play nicely together

Categories

HOME
asp.net
spring-boot
javafx
packet
display
casting
window.open
liquibase
itext7
ms-application-insights
wavefront
genexus
angular-universal
adroitlogic
saucelabs
popup
owncloud
beacon
openoffice-basic
restructuredtext
functional-dependencies
pixels
oracle10g
cloudformation
angular-schema-form
restangular
paper-trail-gem
jcr
dropdownbox
sampling
dom4j
maven-2
gstreamer-1.0
console.readline
rtsp
queryover
pygraphviz
motion
mybatis-generator
ngrok
jslider
android-graphview
ng-class
lucee
enet
ajv
dmalloc
bipartite
was
scanf
portaudio
ldd
networkstream
mate-desktop
syslog4j
avaudiorecorder
laterjs
boost-propertytree
usps
clique
web-optimization
wordpress-plugin
instabug
ewam
page-flipping
tokudb
vspackage
vectordrawable
teamwork
system.io.packaging
qf-test
disparity-mapping
behance-api
ant-contrib
elixir-framework
git-subtree
autofilter
surfaceview
wpd
cloudmade
pageload
brew
ncml
teamsystem
wxperl
project-files
gmagick
simultaneous
xslt-grouping
versions
mysql-pconnect
file-storage
script-tag
atmega16
tracd

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