Skip to content

Commit a2c93c5

Browse files
committed
fix module check
1 parent 2eede41 commit a2c93c5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

public/jsgist-runner.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
}
5959

6060
function makePageHTML(mainHTML, mainJS, mainCSS) {
61-
const isModule = /\bimport|async|await\b/.test(mainJS.content);
61+
const isModule = /\b(import|async|await)\b/.test(mainJS.content);
6262
const module = isModule
6363
? ' type="module"'
6464
: '';

src/components/Export.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ function makeHTML(data, asModule) {
140140
const mainHTML = getOrFind(files, 'index.html', 'html');
141141
const mainJS = getOrFind(files, 'index.js', 'js', 'js', 'javascript');
142142
const mainCSS = getOrFind(files, 'index.css', 'css');
143-
const isModule = asModule !== undefined ? asModule : /\bimport\b/.test(mainJS.content);
143+
const isModule = asModule !== undefined ? asModule : /\b(import|async|await)\b/.test(mainJS.content);
144144
const module = isModule
145145
? ' type="module"'
146146
: '';

0 commit comments

Comments
 (0)