[Autotag] Add CSS injection auto tag

This commit is contained in:
Ducko 2021-03-07 13:41:06 +00:00 committed by Keanu
parent f3948a0daf
commit 6e73a1eab0
Signed by: keanucode
GPG Key ID: A7431C0D513CA93B
1 changed files with 3 additions and 0 deletions

View File

@ -7,6 +7,9 @@ export default (bundleCode) => { // Scans final bundle JS to try and auto-detect
const tags = [
basicIncludes(bundleCode, 'react'),
basicIncludes(bundleCode, 'document', 'DOM'),
(bundleCode.includes('document.createTextNode') && /document\.createElement\(['"`]style['"`]\)/.test(bundleCode)) ? 'CSS' : '',
].filter((x) => x !== undefined);
return tags;