Disable loopProtect for non-JavaScript code

pull/12995/head
Leon Feng 2017-01-31 05:30:23 +04:00
parent 43d69e0e44
commit 30bc87c1da
1 changed files with 5 additions and 0 deletions

View File

@ -24,6 +24,11 @@ const transformersForHtmlJS = {
{
name: 'add-loop-protect',
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);
}
},