From 3c21f3897c6cbe78f2457d81e9fb5bae7d979f49 Mon Sep 17 00:00:00 2001 From: gurushida <49831684+gurushida@users.noreply.github.com> Date: Tue, 16 Nov 2021 18:00:29 +0100 Subject: [PATCH] feat: added disableIncremental option to completely turn off incremental compilation --- src/index.ts | 5 +++++ 1 file changed, 5 insertions(+) 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';