Skip to content

Commit 94a02c0

Browse files
authored
feat: guard for node
1 parent e401ce7 commit 94a02c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export default (options = {}) => {
8888
/* if inject is enabled, we want to simply inject the stylesheet into the document head */
8989
if (options.inject) {
9090
return {
91-
code: `document.head.appendChild(document.createElement("style")).textContent=${JSON.stringify(transformedCode)};`,
91+
code: `if(typeof document!=='undefined')document.head.appendChild(document.createElement("style")).textContent=${JSON.stringify(transformedCode)};`,
9292
map: null
9393
};
9494
}

0 commit comments

Comments
 (0)