From 6e73a1eab0f0e60759f9040aa80638ffa394f464 Mon Sep 17 00:00:00 2001 From: Oj Date: Sun, 7 Mar 2021 13:41:06 +0000 Subject: [PATCH] [Autotag] Add CSS injection auto tag --- src/autoTag.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/autoTag.js b/src/autoTag.js index 42c3e6c..d4b6b1c 100644 --- a/src/autoTag.js +++ b/src/autoTag.js @@ -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;