Skip to content

Commit

Permalink
fix: incorrect position of optional chaining operator
Browse files Browse the repository at this point in the history
closes #493
  • Loading branch information
floydspace committed Sep 20, 2023
1 parent 0d53683 commit f2ae68a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,12 @@ export async function bundle(this: EsbuildServerlessPlugin): Promise<void> {
outdir: path.join(buildDirPath, path.dirname(entry)),
};

const pkg: any = await import('esbuild');
const context: BuildContext = await pkg?.context(options);
const pkg = await import('esbuild');

type ContextFn = (opts: typeof options) => Promise<BuildContext>;
type WithContext = typeof pkg & { context?: ContextFn };
const context = await (pkg as WithContext).context?.(options);

let result = await context?.rebuild();

if (!result) {
Expand Down

0 comments on commit f2ae68a

Please sign in to comment.