There was an error while loading. Please reload this page.
2 parents e401ce7 + 94a02c0 commit 23f3ea4Copy full SHA for 23f3ea4
src/index.js
@@ -88,7 +88,7 @@ export default (options = {}) => {
88
/* if inject is enabled, we want to simply inject the stylesheet into the document head */
89
if (options.inject) {
90
return {
91
- code: `document.head.appendChild(document.createElement("style")).textContent=${JSON.stringify(transformedCode)};`,
+ code: `if(typeof document!=='undefined')document.head.appendChild(document.createElement("style")).textContent=${JSON.stringify(transformedCode)};`,
92
map: null
93
};
94
}
0 commit comments