egoist / style-inject

Inject style tag to document head.
MIT License
48 stars 23 forks source link

Document undefined #5

Closed mserege closed 6 years ago

mserege commented 6 years ago

Hi,

Going from 0.1.2 to 0.2.0 made verification of document variable definition disappeared.

if (typeof document === 'undefined') { return returnValue; }

Would it be possible to put it back so my module can work on server-side without throwing an exception?

Thanks

egoist commented 6 years ago

If you're authoring a js library, it should always extract css instead of injecting to head 😄

but yeah, we can make it return when document is undefined

egoist commented 6 years ago

Fixed in v0.2.1