thgh / rollup-plugin-scss

Rollup and compile multiple .scss, .sass and .css imports
MIT License
134 stars 47 forks source link

Fixing size output conditional #27

Closed ianwalter closed 5 years ago

ianwalter commented 5 years ago

This change prevents the plugin from trying to output size information if css is falsy. In my case, if I have an undefined variable, I get the intended error message, but I also get this other error message that is not relevant:

Error:
    Undefined variable: "$input-box-shadow".

/Users/iwalter/binxhealth/jupiter/node_modules/rollup-plugin-scss/index.cjs.js:120
              console.log(green(dest), getSize(css.length));
                                                   ^

TypeError: Cannot read property 'length' of undefined
    at /Users/iwalter/binxhealth/jupiter/node_modules/rollup-plugin-scss/index.cjs.js:120:52
    at /Users/iwalter/binxhealth/jupiter/node_modules/graceful-fs/graceful-fs.js:45:10
    at FSReqCallback.args [as oncomplete] (fs.js:145:20)
error Command failed with exit code 1.
thgh commented 5 years ago

Makes sense, thanks!

Fixes #26