Skip to content

Commit

Permalink
fixup esm check
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Jul 7, 2021
1 parent 2e1612a commit 135443b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cli.js
Expand Up @@ -244,7 +244,8 @@ async function runCmd (argv, stdout, stderr) {
let startTime = Date.now();
let ps;
const buildFile = eval("require.resolve")(resolve(args._[1] || "."));
const ext = buildFile.endsWith('.cjs') ? '.cjs' : buildFile.endsWith('.mjs') || !hasTypeModule(buildFile) ? '.mjs' : '.js';
const esm = buildFile.endsWith('.mjs') || buildFile.endsWith('.js') && hasTypeModule(buildFile);
const ext = buildFile.endsWith('.cjs') ? '.cjs' : esm && (buildFile.endsWith('.mjs') || !hasTypeModule(buildFile)) ? '.mjs' : '.js';
const ncc = require("./index.js")(
buildFile,
{
Expand Down

0 comments on commit 135443b

Please sign in to comment.