diff --git a/public/jsgist-runner.js b/public/jsgist-runner.js index 8a73ab7..2236fc1 100644 --- a/public/jsgist-runner.js +++ b/public/jsgist-runner.js @@ -58,7 +58,7 @@ } function makePageHTML(mainHTML, mainJS, mainCSS) { - const isModule = /\bimport|async|await\b/.test(mainJS.content); + const isModule = /\b(import|async|await)\b/.test(mainJS.content); const module = isModule ? ' type="module"' : ''; diff --git a/src/components/Export.js b/src/components/Export.js index 28ae2b1..6478268 100644 --- a/src/components/Export.js +++ b/src/components/Export.js @@ -140,7 +140,7 @@ function makeHTML(data, asModule) { const mainHTML = getOrFind(files, 'index.html', 'html'); const mainJS = getOrFind(files, 'index.js', 'js', 'js', 'javascript'); const mainCSS = getOrFind(files, 'index.css', 'css'); - const isModule = asModule !== undefined ? asModule : /\bimport\b/.test(mainJS.content); + const isModule = asModule !== undefined ? asModule : /\b(import|async|await)\b/.test(mainJS.content); const module = isModule ? ' type="module"' : '';