serverless-esbuild
Advanced tools
Comparing version 1.3.1 to 1.4.0
@@ -25,3 +25,4 @@ "use strict"; | ||
target: 'es2017', | ||
external: ['aws-sdk'], | ||
external: [], | ||
exclude: ['aws-sdk'], | ||
packager: 'npm', | ||
@@ -110,3 +111,6 @@ }; | ||
yield Promise.all(this.rootFileNames.map(entry => { | ||
const config = Object.assign(Object.assign({}, this.buildOptions), { entryPoints: [entry], outdir: path.join(this.originalServicePath, BUILD_FOLDER, path.dirname(entry)), platform: 'node' }); | ||
const config = Object.assign(Object.assign({}, this.buildOptions), { external: [ | ||
...this.buildOptions.external, | ||
...this.buildOptions.exclude, | ||
], entryPoints: [entry], outdir: path.join(this.originalServicePath, BUILD_FOLDER, path.dirname(entry)), platform: 'node' }); | ||
return esbuild_1.build(config); | ||
@@ -113,0 +117,0 @@ })); |
@@ -110,3 +110,3 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const externals = ramda_1.without(['aws-sdk'], this.buildOptions.external); | ||
const externals = ramda_1.without(this.buildOptions.exclude, this.buildOptions.external); | ||
if (!externals) { | ||
@@ -113,0 +113,0 @@ return; |
{ | ||
"name": "serverless-esbuild", | ||
"version": "1.3.1", | ||
"version": "1.4.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "author": "Victor Korzunin", |
@@ -42,4 +42,4 @@ # serverless-esbuild | ||
The `aws-sdk` module is exluded from bundle by default, and you can exclude additional dependencies using `external` option. | ||
Check [esbuild](https://github.com/evanw/esbuild#command-line-usage) documentation for the full list of available options. Note that some options like `entryPoints` or `outdir` cannot be overwritten. | ||
The package specified in the `exclude` option is passed to esbuild as `external`, but it is not included in the function bundle either. The default value for this option is `['aws-sdk']`. | ||
@@ -46,0 +46,0 @@ See [example folder](example) for a minimal example. |
41655
735