All Projects → goldwasserexchange → Serverless Plugin Webpack

goldwasserexchange / Serverless Plugin Webpack

Licence: mit
Serverless Plugin Webpack

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Serverless Plugin Webpack

Serverless Sam
Serverless framework plugin to export AWS SAM templates for a service
Stars: ✭ 143 (+98.61%)
Mutual labels:  aws, serverless, aws-lambda, plugin
Serverless Layers
Serverless.js plugin that implements AWS Lambda Layers which reduces drastically lambda size, warm-up and deployment time.
Stars: ✭ 119 (+65.28%)
Mutual labels:  aws, serverless, aws-lambda, optimization
Up
Up focuses on deploying "vanilla" HTTP servers so there's nothing new to learn, just develop with your favorite existing frameworks such as Express, Koa, Django, Golang net/http or others.
Stars: ✭ 8,439 (+11620.83%)
Mutual labels:  aws, serverless, aws-lambda
Lambda Packs
Precompiled packages for AWS Lambda
Stars: ✭ 997 (+1284.72%)
Mutual labels:  aws, serverless, aws-lambda
Ng Toolkit
⭐️ Angular tool-box! Start your PWA in two steps! Add Serverless support for existing projects and much more
Stars: ✭ 1,116 (+1450%)
Mutual labels:  aws, serverless, aws-lambda
Budgeting
Budgeting - React + Redux + Webpack (tree shaking) Sample App
Stars: ✭ 971 (+1248.61%)
Mutual labels:  webpack, webpack2, tree-shaking
Webpack Alioss Plugin
阿里 oss-webpack 自动上传插件
Stars: ✭ 35 (-51.39%)
Mutual labels:  webpack, webpack2, plugin
Chalice
Python Serverless Microframework for AWS
Stars: ✭ 8,513 (+11723.61%)
Mutual labels:  aws, serverless, aws-lambda
Aws Auto Terminate Idle Emr
AWS Auto Terminate Idle AWS EMR Clusters Framework is an AWS based solution using AWS CloudWatch and AWS Lambda using a Python script that is using Boto3 to terminate AWS EMR clusters that have been idle for a specified period of time.
Stars: ✭ 21 (-70.83%)
Mutual labels:  aws, serverless, aws-lambda
Serverless Es Logs
A Serverless plugin to transport logs to ElasticSearch
Stars: ✭ 51 (-29.17%)
Mutual labels:  aws, serverless, aws-lambda
Aws Serverless Java Container
A Java wrapper to run Spring, Jersey, Spark, and other apps inside AWS Lambda.
Stars: ✭ 1,054 (+1363.89%)
Mutual labels:  aws, serverless, aws-lambda
Serverless Export Env
Serverless plugin to export environment variables into a .env file
Stars: ✭ 51 (-29.17%)
Mutual labels:  aws, serverless, aws-lambda
Serverless Plugin Stackstorm
Plugin for serverless framework to run ready to use actions from StackStorm Exchange as AWS Lambda.
Stars: ✭ 28 (-61.11%)
Mutual labels:  aws, serverless, aws-lambda
Graphql Serverless
Sample project to guide the use of GraphQL and Serverless Architecture.
Stars: ✭ 28 (-61.11%)
Mutual labels:  aws, serverless, aws-lambda
Apex
Old apex/apex
Stars: ✭ 20 (-72.22%)
Mutual labels:  aws, serverless, aws-lambda
Aws Lambda Dotnet
Libraries, samples and tools to help .NET Core developers develop AWS Lambda functions.
Stars: ✭ 945 (+1212.5%)
Mutual labels:  aws, serverless, aws-lambda
Terraform Nextjs Plugin
A plugin to generate terraform configuration for Nextjs 8 and 9
Stars: ✭ 41 (-43.06%)
Mutual labels:  aws, serverless, plugin
Contacts api
Serverless RESTful API with AWS Lambda, API Gateway and DynamoDB
Stars: ✭ 66 (-8.33%)
Mutual labels:  aws, serverless, aws-lambda
Cloudmagick
CloudMagick is a serverless application which provides a dynamic image transformation like the small light module of apache2
Stars: ✭ 11 (-84.72%)
Mutual labels:  aws, serverless, aws-lambda
Step Functions Demo
This is a demo project, created as a part of the blog post. The project uses serverless for deployments.
Stars: ✭ 15 (-79.17%)
Mutual labels:  aws, serverless, aws-lambda

Serverless Plugin Webpack

serverless npm version Build Status Coverage Status dependencies Greenkeeper badge

A serverless plugin to automatically bundle your functions individually with webpack.

Compared to other webpack/optimization plugins, this plugin has the following features/advantages:

  • Zero configuration
  • Supports sls package, sls deploy and sls deploy function
  • Functions are packaged individually, resulting in Lambda deployment packages (zip) containing only the code needed to run the function (no bloat)
  • 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).

This plugin is partially based on Serverless Webpack.

Install

Using npm:

npm install serverless-plugin-webpack --save-dev

Add the plugin to your serverless.yml file:

plugins:
  - serverless-plugin-webpack

Package exclude / include

The 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.

Webpack configuration

By 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:

custom:
  webpack:
    config: ./path/to/config/file.js
    series: true # run Webpack in series, useful for large projects. Defaults to false.

The entry and output objects are set by the plugin.

Example of webpack config:

module.exports = {
  // entry: set by the plugin
  // output: set by the plugin
  target: 'node',
  externals: [
    /aws-sdk/, // Available on AWS Lambda
  ],
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        loader: 'babel-loader',
        query: {
          presets: [
            [
              'env',
              {
                target: { node: '6.10' }, // Node version on AWS Lambda
                useBuiltIns: true,
                modules: false,
                loose: true,
              },
            ],
            'stage-0',
          ],
        },
      },
    ],
  },
};

If you want to further optimize the bundle and are using ES6 features, you can use the UglifyJS Webpack Plugin together with the harmony branch of UglifyJS 2 or the Babili Webpack Plugin.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].