0.2.8 • Published 4 years ago

next-aws-lambda-webpack-plugin v0.2.8

Weekly downloads
223
License
ISC
Repository
-
Last release
4 years ago

next-aws-lambda-webpack-plugin

npm puppeteer package integration test next@latest

This plugin will generate aws-lambda compatible function for each Next.JS pages. After that, you can to use theses functions with the AWS cloudformation template or/and AWS serverless template.

This plugin use next-aws-lambda package, create by and for the serverless community :heart:.

:point_right: Here a full implementation example (step by step)

next-aws-lambda-webpack-plugin

Requirement

  1. Use Next.JS CLI for build your project (next build)
  2. Use SAM or AWS CLI cloudformation for your deployment.

Next.JS compatibility

Next.JS VersionTests
canaryintegration test next@canary
latestintegration test next@latest
10.0.5integration test next@latest
9.5.0integration test next@latest
9.4.0integration test next@latest

Install

Use npm :

npm install --save-dev next-aws-lambda-webpack-plugin

Add the plugin to the Next.JS (next.config.js) configuration file.

Plugin ArgumentsRequiredDescription
nextJsConfigYESNext.JS config retrieve from#next.config.js, see example below.
optionsNOsee options

Example:

const GenerateAwsLambda = require('next-aws-lambda-webpack-plugin');

module.exports = {
    target: 'serverless',
    webpack: (config, nextConfig) => {
        config.plugins.push(new GenerateAwsLambda(nextConfig));
        return config
    },
};

Options

Plugin OptionsRequiredDefaultDescription
distDirNo"out_lambda"Custom lambda build directory.
prefixNo"l"Prefix apply to each lambda directory.
pagesNo[]A whitelist who specified SSR pages. If empty array is specified all pages are generated.

Example:

//...snip...
new AwsLambdaGenerator(nextConfig,{
    distDir: 'lambda_build'
})
//...snip...

Architecture Example

:point_right: Go to example

cloud-front-distribution-example

0.2.8

4 years ago

0.2.7

5 years ago

0.2.5

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.2.0-canary-2

5 years ago

0.2.0-canary-1

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.3

5 years ago

0.0.4

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago