Merge pull request #12995 from leonfeng/fix/loop-protect-html
Disable loopProtect for non-JavaScript codepull/13022/head
commit
9f858700d7
|
@ -24,6 +24,11 @@ const transformersForHtmlJS = {
|
||||||
{
|
{
|
||||||
name: 'add-loop-protect',
|
name: 'add-loop-protect',
|
||||||
transformer: function addLoopProtect(file) {
|
transformer: function addLoopProtect(file) {
|
||||||
|
const _contents = file.contents.toLowerCase();
|
||||||
|
if (file.ext === 'html' && !_contents.includes('<script>')) {
|
||||||
|
// No JavaScript in user code, so no need for loopProtect
|
||||||
|
return updateContents(file.contents, file);
|
||||||
|
}
|
||||||
return updateContents(loopProtect(file.contents), file);
|
return updateContents(loopProtect(file.contents), file);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue