{"library":"serverless-webpack","title":"serverless-webpack","description":"A Serverless Framework plugin that bundles Lambda function code using Webpack, enabling tree-shaking, individual packaging, Babel transpilation, and custom loaders. Current stable version is 5.15.4, released April 2025. Requires Node.js >= 20 and supports Serverless v1 through v4 (with esbuild disabled in v4). Active development with monthly releases. Compared to serverless-bundle or serverless-esbuild, this plugin offers broader Webpack version support (3, 4, 5), NPM/Yarn packaging, async webpack config, and seamless integration with serverless-offline.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install serverless-webpack"],"cli":null},"imports":["plugins:\n  - serverless-webpack","const slsw = require('serverless-webpack')","slsw.lib","import ServerlessWebpack from 'serverless-webpack';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"npm install serverless-webpack --save-dev\n\n# serverless.yml\nservice: my-service\nplugins:\n  - serverless-webpack\nprovider:\n  name: aws\n  runtime: nodejs20.x\ncustom:\n  webpack:\n    webpackConfig: 'webpack.config.js'\n    includeModules: false\nfunctions:\n  hello:\n    handler: handler.hello\n\n// webpack.config.js\nconst path = require('path');\nmodule.exports = {\n  entry: './handler.js',\n  target: 'node',\n  output: {\n    libraryTarget: 'commonjs2',\n    path: path.join(__dirname, '.webpack'),\n    filename: '[name].js',\n  },\n};\n\n// handler.js\nexports.hello = async (event) => {\n  return { statusCode: 200, body: 'Hello from serverless-webpack!' };\n};","lang":"javascript","description":"Initialize a Serverless service with serverless-webpack, install plugin, configure webpack for Node.js target, and create a basic handler.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}