Skip to content

Commit

Permalink
fix(utils): prevent errors for modules without resources
Browse files Browse the repository at this point in the history
  • Loading branch information
rajdee committed Mar 18, 2018
1 parent 6a2e1f8 commit 467daa6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/utils/mapped-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ class MappedList {
const { symbols, spriteModules, allModules, rules } = this;
const data = symbols.reduce((acc, symbol) => {
const resource = symbol.request.file;
const module = spriteModules.find(m => m.resource.split('?')[0] === resource);
const module = spriteModules.find(m => 'resource' in m
? m.resource.split('?')[0] === resource
: false
);
const rule = getMatchedRule(resource, rules);
const options = rule ? getLoaderOptions(spriteLoaderPath, rule) : null;
let spriteFilename = (options && options.spriteFilename)
Expand Down

0 comments on commit 467daa6

Please sign in to comment.