Skip to content
This repository was archived by the owner on Aug 16, 2022. It is now read-only.

Commit d076f8d

Browse files
perempperemp
and
peremp
authored
chore: move head declaration to avoid issue in ssr (#87)
Co-authored-by: peremp <[email protected]>
1 parent 7b4dceb commit d076f8d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/assembler.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ export function assembleFromSource(
9090

9191
// language=JavaScript
9292
const inlineCreateInjector = `function __vue_create_injector__() {
93-
const head = document.head || document.getElementsByTagName('head')[0]
9493
const styles = __vue_create_injector__.styles || (__vue_create_injector__.styles = {})
9594
const isOldIE =
9695
typeof navigator !== 'undefined' &&
@@ -124,6 +123,7 @@ export function assembleFromSource(
124123
}
125124
126125
if (!style.element) {
126+
const head = document.head || document.getElementsByTagName('head')[0]
127127
const el = style.element = document.createElement('style')
128128
el.type = 'text/css'
129129

0 commit comments

Comments
 (0)