Skip to content

Commit

Permalink
#86 Fix case sensitivity in responsive images
Browse files Browse the repository at this point in the history
  • Loading branch information
Quicksaver committed Jul 24, 2018
1 parent 76e36c3 commit f71b348
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/SrcSet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const buildSrcSet = (src) => {
const ext = chunks.pop();

// We don't build a srcset if we won't have any responsive images built for this src image.
if (sharpConfig.types.indexOf(ext) === -1) {
if (sharpConfig.types.indexOf(ext.toLowerCase()) === -1) {
return null;
}

Expand Down
8 changes: 7 additions & 1 deletion scripts/sharp.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,13 @@ const deleteProcessedImages = imagePath => new Promise((resolve) => {
});

const processAllImages = () => new Promise((resolve, reject) => {
glob(`${src}/**/*.+(${[ ...types ].join('|')})`, {}, (err, images) => {
const pattern = `${src}/**/*.+(${[ ...types ].join('|')})`;

const options = {
nocase: true,
};

glob(pattern, options, (err, images) => {
if (err) {
reject(err);
return;
Expand Down

0 comments on commit f71b348

Please sign in to comment.