purifycss / grunt-purifycss

Remove unused CSS with the grunt build tool
MIT License
163 stars 21 forks source link

Bug Fix for undefined #11

Open amrdraz opened 9 years ago

amrdraz commented 9 years ago

I would get

   Warning: Cannot read property 'forEach' of undefined Use --force to continue.  
   TypeError: Cannot read property 'forEach' of undefined
    at Object.<anonymous> (/node_modules/grunt-purifycss/tasks/purifycss.js:22:18)
   .
   .

and then the task would stop

looking at the grunt API I noticed that data simply returns the object value I passed in my config which if according to the example is inside data.target not the data object itself

using grunt 0.4.5 (but I got that from the latest documentation for the API

kennyt commented 8 years ago

Hmm, I can't seem to reproduce this. If I make it data.target.src I get undefined