mrsum / webpack-svgstore-plugin

Simple svg-sprite creating with webpack
https://www.npmjs.com/package/webpack-svgstore-plugin
200 stars 92 forks source link

Fixes DOM access before it is ready #160

Closed melloc01 closed 6 years ago

melloc01 commented 6 years ago

Adding DOMContentLoaded listener before adding the div sprite to the DOM.

When your script is loaded in the <head> of the document, <body> isn't accessible yet, so this is necessary.

melloc01 commented 6 years ago

@mrsum - this is a very straightforward improvement, would you merge and release a minor asap?

It's currently bocking me. Didn't want to change deps to my fork : )

lgordey commented 6 years ago

@melloc01 Check v4.0.2

melloc01 commented 6 years ago

Sweet! Thanks!

I'd like to improve the README.md because it took me awhile (actually had to look at the source code) to understand how it works. Will make a PR asap!

Thanks for the repo - really like the idea :grin: