extract-css-chunks-webpack-plugin
extract-css-chunks-webpack-plugin copied to clipboard
Fix errors when accessing document global on server
When using the plugin in a server-side rendering context there is no document global where script or link tags could be added to. In this case typically all scripts and link tags are collected and added by the renderer itself so nothing needs to be executed by the plugin on require.
This patch detects the existence of the document global and skips adding nodes if it doesn't exist. Also fixed test cases. Feedback welcome, maybe there is a better way to do this?
This should also fix #296