Skip to content

Commit

Permalink
fix(postcss-plugin): Skip css files without icons
Browse files Browse the repository at this point in the history
  • Loading branch information
jantimon committed Sep 13, 2016
1 parent 8413ebb commit ee24526
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/postcss-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ module.exports = postcss.plugin('iconfont-webpack', function (opts) {
var context = path.dirname(cssFilename);
return getSvgPaths(root, opts.compilation.compiler, context)
.then(function (svgPaths) {
// Stop if the css file contains no `font-icon:url('..');` declarations
if (svgPaths.resolved.lenth === 0) {
return;
}
// Generate a font icon name
var md5sum = crypto.createHash('md5');
md5sum.update(JSON.stringify(_.values(svgPaths.resolved)));
Expand Down

0 comments on commit ee24526

Please sign in to comment.