diff --git a/css_wrap.js b/css_wrap.js index c9533d9..3804c63 100644 --- a/css_wrap.js +++ b/css_wrap.js @@ -41,10 +41,15 @@ var skip: null }, options || {}); if (fs.existsSync(path.resolve(string))) { - string = fs.readFileSync(string).toString(); + try { + string = fs.readFileSync(string).toString() + } catch (error) { + console.log('empty file skipped!'); + return ''; + } } var css = css_parse( string ); css.stylesheet.rules = processRules( css.stylesheet.rules, options ); return css_stringify( css ); }; -module.exports = css_wrap; \ No newline at end of file +module.exports = css_wrap;