{"id":14976371,"url":"https://github.com/goldwasserexchange/serverless-plugin-webpack","last_synced_at":"2025-08-20T06:32:24.836Z","repository":{"id":71897827,"uuid":"84434324","full_name":"goldwasserexchange/serverless-plugin-webpack","owner":"goldwasserexchange","description":"Serverless Plugin Webpack","archived":false,"fork":false,"pushed_at":"2023-02-27T18:29:26.000Z","size":421,"stargazers_count":75,"open_issues_count":13,"forks_count":14,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-15T17:07:02.550Z","etag":null,"topics":["aws","aws-lambda","optimization","plugin","serverless","tree-shaking","webpack","webpack2"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/goldwasserexchange.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-09T11:26:10.000Z","updated_at":"2023-04-05T07:57:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"8f8b4b2c-137d-4d79-bda4-1d66b171b536","html_url":"https://github.com/goldwasserexchange/serverless-plugin-webpack","commit_stats":{"total_commits":58,"total_committers":9,"mean_commits":6.444444444444445,"dds":0.4482758620689655,"last_synced_commit":"062277047a8d597802693b48688e84b6c5357088"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goldwasserexchange%2Fserverless-plugin-webpack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goldwasserexchange%2Fserverless-plugin-webpack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goldwasserexchange%2Fserverless-plugin-webpack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goldwasserexchange%2Fserverless-plugin-webpack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/goldwasserexchange","download_url":"https://codeload.github.com/goldwasserexchange/serverless-plugin-webpack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230400615,"owners_count":18219831,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-lambda","optimization","plugin","serverless","tree-shaking","webpack","webpack2"],"created_at":"2024-09-24T13:53:47.576Z","updated_at":"2024-12-19T08:08:02.523Z","avatar_url":"https://github.com/goldwasserexchange.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Serverless Plugin Webpack\n\n[![serverless](http://public.serverless.com/badges/v3.svg)](http://www.serverless.com)\n[![npm version](https://badge.fury.io/js/serverless-plugin-webpack.svg)](https://badge.fury.io/js/serverless-plugin-webpack)\n[![Build Status](https://travis-ci.org/goldwasserexchange/serverless-plugin-webpack.svg?branch=master)](https://travis-ci.org/goldwasserexchange/serverless-plugin-webpack)\n[![Coverage Status](https://coveralls.io/repos/github/goldwasserexchange/serverless-plugin-webpack/badge.svg?branch=master)](https://coveralls.io/github/goldwasserexchange/serverless-plugin-webpack?branch=master)\n[![dependencies](https://david-dm.org/goldwasserexchange/serverless-plugin-webpack.svg)](https://www.npmjs.com/package/serverless-plugin-webpack)\n[![Greenkeeper badge](https://badges.greenkeeper.io/goldwasserexchange/serverless-plugin-webpack.svg)](https://greenkeeper.io/)\n\nA [serverless](http://www.serverless.com) plugin to **automatically** bundle your functions **individually** with [webpack](https://webpack.js.org).\n\nCompared to other webpack/optimization plugins, this plugin has the following features/advantages:\n- Zero configuration\n- Supports `sls package`, `sls deploy` and `sls deploy function`\n- Functions are packaged individually, resulting in Lambda deployment packages (zip) containing only the code needed to run the function (no bloat)\n- Uses an *array* of webpack configurations instead of one webpack configuration with multiple entry points, resulting in better tree-shaking because dependencies are isolated (see [Tree shaking](https://github.com/FormidableLabs/formidable-playbook/blob/master/docs/frontend/webpack-tree-shaking.md)).\n\nThis plugin is partially based on [Serverless Webpack](https://github.com/elastic-coders/serverless-webpack).\n\n## Install\nUsing npm:\n```\nnpm install serverless-plugin-webpack --save-dev\n```\n\nAdd the plugin to your `serverless.yml` file:\n```yaml\nplugins:\n  - serverless-plugin-webpack\n```\n\n## Package exclude / include\nThe plugin will add `'**'` as an `exclude` at the service level and each bundled javascript file as an `include` at the function level. Original includes and excludes specified in your `serverless.yml` are preserved.\n\n## Webpack configuration\nBy default the plugin will look for a `webpack.config.js` in the service root. You can specify a custom config file in your `serverless.yml`:\n```yaml\ncustom:\n  webpack:\n    config: ./path/to/config/file.js\n    series: true # run Webpack in series, useful for large projects. Defaults to false.\n```\n\nThe `entry` and `output` objects are set by the plugin.\n\nExample of webpack config:\n```javascript\nmodule.exports = {\n  // entry: set by the plugin\n  // output: set by the plugin\n  target: 'node',\n  externals: [\n    /aws-sdk/, // Available on AWS Lambda\n  ],\n  module: {\n    rules: [\n      {\n        test: /\\.js$/,\n        exclude: /node_modules/,\n        loader: 'babel-loader',\n        query: {\n          presets: [\n            [\n              'env',\n              {\n                target: { node: '6.10' }, // Node version on AWS Lambda\n                useBuiltIns: true,\n                modules: false,\n                loose: true,\n              },\n            ],\n            'stage-0',\n          ],\n        },\n      },\n    ],\n  },\n};\n```\n\nIf you want to further optimize the bundle and are using ES6 features, you can use the [UglifyJS Webpack Plugin](https://github.com/webpack-contrib/uglifyjs-webpack-plugin) together with the harmony branch of [UglifyJS 2](https://github.com/mishoo/UglifyJS2#harmony) or the [Babili Webpack Plugin](https://github.com/webpack-contrib/babili-webpack-plugin).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoldwasserexchange%2Fserverless-plugin-webpack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoldwasserexchange%2Fserverless-plugin-webpack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoldwasserexchange%2Fserverless-plugin-webpack/lists"}