serverless-esbuild
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -17,2 +17,3 @@ "use strict"; | ||
const path = require("path"); | ||
const ramda_1 = require("ramda"); | ||
const helper_1 = require("./helper"); | ||
@@ -93,10 +94,12 @@ const SERVERLESS_FOLDER = '.serverless'; | ||
} | ||
const defaultOptions = { | ||
const concatUniq = ramda_1.compose(ramda_1.uniq, ramda_1.concat); | ||
const withDefaultOptions = ramda_1.mergeWith(concatUniq, { | ||
bundle: true, | ||
}; | ||
external: ['aws-sdk'], | ||
}); | ||
yield Promise.all(this.rootFileNames.map(entry => { | ||
const config = Object.assign(Object.assign(Object.assign({}, defaultOptions), options), { entryPoints: [entry], outdir: path.join(this.originalServicePath, BUILD_FOLDER, path.dirname(entry)), platform: 'node', stdio: 'inherit' }); | ||
const config = withDefaultOptions(Object.assign(Object.assign({}, options), { entryPoints: [entry], outdir: path.join(this.originalServicePath, BUILD_FOLDER, path.dirname(entry)), platform: 'node', stdio: 'inherit' })); | ||
return esbuild_1.build(config); | ||
})); | ||
this.serverless.cli.log('Bundling completed.'); | ||
this.serverless.cli.log('Compiling completed.'); | ||
}); | ||
@@ -103,0 +106,0 @@ } |
{ | ||
"name": "serverless-esbuild", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"license": "MIT", | ||
@@ -48,2 +48,3 @@ "author": "Victor Korzunin", | ||
"@types/node": "^12.12.38", | ||
"@types/ramda": "^0.27.6", | ||
"@types/serverless": "^1.67.2", | ||
@@ -63,4 +64,5 @@ "@typescript-eslint/eslint-plugin": "^2.33.0", | ||
"fs-extra": "^9.0.0", | ||
"globby": "^11.0.0" | ||
"globby": "^11.0.0", | ||
"ramda": "^0.27.0" | ||
} | ||
} |
@@ -40,2 +40,3 @@ # 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. | ||
@@ -42,0 +43,0 @@ |
16748
208
112
4
16
+ Addedramda@^0.27.0
+ Addedramda@0.27.2(transitive)