mike-diamond / media-query-splitting-plugin

Webpack 4 plugin for styles splitting by media query
MIT License
106 stars 17 forks source link

Need use document.readyState #9

Closed romanlex closed 5 years ago

romanlex commented 5 years ago

I found what In your plugin DOMContentLoaded event not fired You need use document.readyState for check this Example

if(document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded',afterDOMLoaded);
} else {
    afterDOMLoaded();
}

function afterDOMLoaded(){
    //Everything that needs to happen after the DOM has initially loaded.
}
mike-diamond commented 5 years ago

Implemented in v. 1.1.14