File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change 1
1
import assert from 'assert' ;
2
2
import { Predicate } from 'effect' ;
3
3
import type { BuildOptions } from 'esbuild' ;
4
+ import * as pkg from 'esbuild' ;
4
5
import fs from 'fs-extra' ;
5
6
import pMap from 'p-map' ;
6
7
import path from 'path' ;
@@ -104,11 +105,9 @@ export async function bundle(this: EsbuildServerlessPlugin): Promise<void> {
104
105
outdir : path . join ( buildDirPath , path . dirname ( entry ) ) ,
105
106
} ;
106
107
107
- const pkg = await import ( 'esbuild' ) ;
108
-
109
108
type ContextFn = ( opts : typeof options ) => Promise < BuildContext > ;
110
109
type WithContext = typeof pkg & { context ?: ContextFn } ;
111
- const context = await ( pkg as WithContext ) . context ?.( options ) ;
110
+ const context = buildOptions . skipRebuild ? undefined : await ( pkg as WithContext ) . context ?.( options ) ;
112
111
113
112
let result ;
114
113
if ( ! buildOptions . skipRebuild ) {
You can’t perform that action at this time.
0 commit comments