diff --git a/src/index.ts b/src/index.ts index f4fd7aa4..a19e6e10 100644 --- a/src/index.ts +++ b/src/index.ts @@ -47,6 +47,7 @@ export interface Configuration extends Omit = { @@ -277,6 +278,9 @@ export class EsbuildServerlessPlugin implements ServerlessPlugin { async bundle(incremental = false): Promise { this.prepare(); this.serverless.cli.log(`Compiling to ${this.buildOptions.target} bundle with esbuild...`); + if (this.buildOptions.disableIncremental === true) { + incremental = false; + } const bundleMapper = async (bundleInfo) => { const { entry, func, functionAlias } = bundleInfo; @@ -305,6 +309,7 @@ export class EsbuildServerlessPlugin implements ServerlessPlugin { delete config['keepOutputDirectory']; delete config['packagerOptions']; delete config['installExtraArgs']; + delete config['disableIncremental']; const bundlePath = entry.substr(0, entry.lastIndexOf('.')) + '.js';