Skip to content

Commit

Permalink
Update buildDynamicImport
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSodaSea committed Dec 21, 2022
1 parent 083ab30 commit 9b21005
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/babel-helper-module-transforms/src/dynamic-import.ts
Expand Up @@ -17,7 +17,7 @@ export function getDynamicImportSource(

export function buildDynamicImport(
node: t.CallExpression,
deferedToThen: boolean,
deferToThen: boolean,
wrapWithPromise: boolean,
builder: (specifier: t.Expression) => t.Expression,
): t.Expression {
Expand All @@ -27,7 +27,7 @@ export function buildDynamicImport(
t.isStringLiteral(specifier) ||
(t.isTemplateLiteral(specifier) && specifier.quasis.length === 0)
) {
if (deferedToThen) {
if (deferToThen) {
return template.expression.ast`
Promise.resolve().then(() => ${builder(specifier)})
`;
Expand All @@ -41,7 +41,7 @@ export function buildDynamicImport(
[t.identifier("specifier")],
);

if (deferedToThen) {
if (deferToThen) {
return template.expression.ast`
(specifier =>
new Promise(r => r(${specifierToString}))
Expand Down

0 comments on commit 9b21005

Please sign in to comment.