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

how to enable intellisense in Visual Studio Code?
gulp dependency breaks gulp in the middle
No CSS with Gulp
gulp move files to parent directory
How to get gulp-jshint to ignore folders
Inserting specific file at index of a stream
How to pass array from gulp to other js files?
BrowserSync + Gulp with Vagrant not refreshing
gulp-tslint return undefined when required
Gulp watch only runs once
Gulp watch not working with imported files but works with main file
Gulp watch for css doesn't work
Using gulp for compiling of changed files only
How to run gulp task in visual studio code?
BrowserSync with custom URL
Multi-tenancy and Semantic UI

Categories

HOME
ckan
marie
leaflet
ssh
qemu
highmaps
nltk
spss
pandoc
query-string
snmp
genexus
yacc
sahi
token
angularjs-ng-repeat
rename
unreal-engine4
osclass
solidity
resharper
derby
openstack-horizon
ibatis
hapijs
cherrypy
pumping-lemma
inspec
ballerinalang
typeclass
ds-5
folder
drawrect
blockly
imdb
circle
matlab-compiler
device-driver
oracle-bpm-suite
area
mybatis-generator
ape-phylo
inner-join
activeandroid
serverless-architecture
ionic2-select
enet
kendo-scheduler
selection-sort
dbi
git-push
boost-range
foreground
rowname
deck.js
scriptengine
angularfire
django-celery
database-administration
code-translation
instabug
web-performance
encode
android-contentresolver
ios8-share-extension
jsoncpp
android-filterable
tokudb
parseexception
beagleboard
caption
nsurlrequest
nspopupbutton
cs193p
ant-contrib
smartxls
sigma-grid-control
image-preloader
object-oriented-database
ardor3d
ie-developer-tools
blotter
ncml
screensharing
yii-components
correctness
expresso-store
jquery-ui-map
django-1.4
scsf
cryptolicensing
chars
nstoolbar
coderush-xpress
pixel-bender
datadude

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