webpack-lambda-layer-plugin
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

Webpack Lambda Layer Plugin

Efficiently Package Required Node Modules for Your Lambda Layer

npm version Dependency Status Blazing Fast
Main Programming Language Last Commit License Code Style: Prettier

Webpack Lambda Layer Plugin is a tool designed to simplify the process of packaging code libraries for your Lambda functions. The plugin works by bundling the necessary node dependencies as a separate package, which can then be utilized in your Lambda Layer, providing an efficient way to share code libraries with multiple Lambda Functions.

Simultaneously, these dependencies will get externalized from your Lambda Function bundles, leading to reduced bundle sizes and improved build and deployment times.

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.

Package Sidebar

Install

npm i webpack-lambda-layer-plugin

Weekly Downloads

1

Version

1.1.0

License

MIT

Unpacked Size

10.6 kB

Total Files

5

Last publish

Collaborators

  • hrithviksood