Skip to content

Commit

Permalink
fix(build): disabling incremental build outside of offline use (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
olup committed May 6, 2021
1 parent 457e513 commit dde6da8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ export class EsbuildPlugin implements Plugin {
await this.copyExtras();
},
'before:offline:start': async () => {
await this.bundle();
await this.bundle(true);
await this.packExternalModules();
await this.copyExtras();
await this.preOffline();
this.watch();
},
'before:offline:start:init': async () => {
await this.bundle();
await this.bundle(true);
await this.packExternalModules();
await this.copyExtras();
await this.preOffline();
Expand Down Expand Up @@ -201,7 +201,7 @@ export class EsbuildPlugin implements Plugin {
}
}

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

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

if (this.buildResults) {
const { result } = this.buildResults.find(({func: fn}) => fn.name === func.name);
const { result } = this.buildResults.find(({ func: fn }) => fn.name === func.name);
await result.rebuild();
return { result, bundlePath, func };
}
Expand Down

0 comments on commit dde6da8

Please sign in to comment.