Skip to content

Commit dde6da8

Browse files
authored
fix(build): disabling incremental build outside of offline use (#125)
1 parent 457e513 commit dde6da8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,14 @@ export class EsbuildPlugin implements Plugin {
9191
await this.copyExtras();
9292
},
9393
'before:offline:start': async () => {
94-
await this.bundle();
94+
await this.bundle(true);
9595
await this.packExternalModules();
9696
await this.copyExtras();
9797
await this.preOffline();
9898
this.watch();
9999
},
100100
'before:offline:start:init': async () => {
101-
await this.bundle();
101+
await this.bundle(true);
102102
await this.packExternalModules();
103103
await this.copyExtras();
104104
await this.preOffline();
@@ -201,7 +201,7 @@ export class EsbuildPlugin implements Plugin {
201201
}
202202
}
203203

204-
async bundle(incremental = true): Promise<BuildResult[]> {
204+
async bundle(incremental = false): Promise<BuildResult[]> {
205205
this.prepare();
206206
this.serverless.cli.log('Compiling with esbuild...');
207207

@@ -229,7 +229,7 @@ export class EsbuildPlugin implements Plugin {
229229
const bundlePath = entry.substr(0, entry.lastIndexOf('.')) + '.js';
230230

231231
if (this.buildResults) {
232-
const { result } = this.buildResults.find(({func: fn}) => fn.name === func.name);
232+
const { result } = this.buildResults.find(({ func: fn }) => fn.name === func.name);
233233
await result.rebuild();
234234
return { result, bundlePath, func };
235235
}

0 commit comments

Comments
 (0)