webpack-lambda-layer-plugin
v1.1.0
Published
Webpack plugin to export used node_modules as a separate package for the lambda layer
Downloads
6
Maintainers
Readme
Installation
yarn
yarn add --dev webpack-lambda-layer-plugin
npm
npm i --save-dev webpack-lambda-layer-plugin
Usage
webpack.config.js
import { LambdaLayerExternalsPlugin } from "webpack-lambda-layer-plugin";
const config: WebpackConfiguration = {
entry: "index.js",
output: {
filename: "[name]/handler.js",
path: path.resolve("dist"),
},
plugins: [
new LambdaLayerExternalsPlugin(),
],
}
export default config;
This will generate a zip archive dist/externals.zip
containing the used node_modules dependencies, alongside your Lambda Function bundles.