Skip to content

Commit ee24526

Browse files
committed
fix(postcss-plugin): Skip css files without icons
1 parent 8413ebb commit ee24526

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/postcss-plugin.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ module.exports = postcss.plugin('iconfont-webpack', function (opts) {
7979
var context = path.dirname(cssFilename);
8080
return getSvgPaths(root, opts.compilation.compiler, context)
8181
.then(function (svgPaths) {
82+
// Stop if the css file contains no `font-icon:url('..');` declarations
83+
if (svgPaths.resolved.lenth === 0) {
84+
return;
85+
}
8286
// Generate a font icon name
8387
var md5sum = crypto.createHash('md5');
8488
md5sum.update(JSON.stringify(_.values(svgPaths.resolved)));

0 commit comments

Comments
 (0)