diff --git a/packages/package-bundler/src/presets/shared-ui/utils/styleInject.ts b/packages/package-bundler/src/presets/shared-ui/utils/styleInject.ts deleted file mode 100644 index bbbcbe3892a..00000000000 --- a/packages/package-bundler/src/presets/shared-ui/utils/styleInject.ts +++ /dev/null @@ -1,27 +0,0 @@ -// Auto-generated by package-bundler -// Forked from https://github.com/egoist/style-inject -export function styleInject(css: string, { insertAt }: { insertAt?: 'top' } = {}): void { - if (!css || typeof document === 'undefined') return - - const head = document.head || document.getElementsByTagName('head')[0] - const style = document.createElement('style') - style.type = 'text/css' - - if (insertAt === 'top') { - if (head.firstChild) { - head.insertBefore(style, head.firstChild) - } else { - head.appendChild(style) - } - } else { - head.appendChild(style) - } - - // @ts-ignore - if (style.styleSheet) { - // @ts-ignore - style.styleSheet.cssText = css - } else { - style.appendChild(document.createTextNode(css)) - } -}