Skip to content

Commit

Permalink
fix module check
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Dec 29, 2023
1 parent 2eede41 commit a2c93c5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion public/jsgist-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"'
: '';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Export.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"'
: '';
Expand Down

0 comments on commit a2c93c5

Please sign in to comment.