Skip to content

A serverless bundler which integrates with invoke local and deploy

License

Notifications You must be signed in to change notification settings

lteacher/serverless-plugin-bundler

Repository files navigation

Serverless Bundler Plugin

Note: This package is unpublished. I was trolled by near identical named packages and now I have found an acceptable package so the world does not need this...

Allows project bundling via webpack for serverless invoke local and deploy

Build Status Coverage Status

Install

In your serverless project, run npm or yarn install. Note that to import the webpack config you also need the serverless-plugin-js-import

npm install --save-dev serverless-plugin-bundler serverless-plugin-js-import

You need to be running webpack in your project, so npm i --save-dev webpack if you dont have it

Setup

Configure both plugins in the serverless.yml like:

plugins:
  - serverless-plugin-bundler
  - serverless-plugin-js-import

Usage

Option 1

Include a webpack configuration via import to an existing config file

custom:
  webpack: ${file(./webpack.config.js)}

Option 2 - (Experimental)

Include a webpack configuration, also in serverless.yml like (example only)

custom:
  webpack:
    entry: ./handler.js
    target: node
    output:
      libraryTarget: umd
      filename: handler.js
      path: dist/
    module:
      loaders:
        -
          test: /\.js$/
          exclude: /(node_modules|dist)/
          loader: babel-loader

Config

The bundler has some minimal configuration here are the options which also go into the custom section of the yaml under bundler exactly as shown

custom:
  bundler:
    logging: true # Enables logging. SLS_DEBUG=* also enables this
    clean: true   # Allows for not cleaning the output dir. Defaults to true

About

A serverless bundler which integrates with invoke local and deploy

Resources

License

Stars

Watchers

Forks

Packages

No packages published