All Projects → threadheap → serverless-plugin-parcel

threadheap / serverless-plugin-parcel

Licence: other
A Serverless framework plugin to bundle assets with Parcel (ES6/7 or Typescript)

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to serverless-plugin-parcel

serverless-plugin-epsagon
Epsagon's plugin for Serverless Framework ⚡️
Stars: ✭ 53 (+130.43%)
Mutual labels:  lambda, serverless-plugin
serverless-plugin-lambda-dead-letter
serverless plugin that can configure a lambda with a dead letter queue or topic
Stars: ✭ 42 (+82.61%)
Mutual labels:  lambda, serverless-plugin
Serverless Webpack
Serverless plugin to bundle your lambdas with Webpack
Stars: ✭ 1,595 (+6834.78%)
Mutual labels:  serverless-plugin, serverless-offline
serverless-certificate-creator
serverless plugin to manage the certificate of your lambdas custom domain (API Gateway=
Stars: ✭ 33 (+43.48%)
Mutual labels:  lambda, serverless-plugin
Serverless Es Logs
A Serverless plugin to transport logs to ElasticSearch
Stars: ✭ 51 (+121.74%)
Mutual labels:  lambda, serverless-plugin
Serverless Bundle
Optimized packages for ES6 and TypeScript Node.js Lambda functions without any configuration.
Stars: ✭ 295 (+1182.61%)
Mutual labels:  lambda, serverless-plugin
serverless-plugin-bespoken
⚡ Serverless plugin to use our bst proxy tool
Stars: ✭ 29 (+26.09%)
Mutual labels:  lambda, serverless-plugin
Serverless Chrome
🌐 Run headless Chrome/Chromium on AWS Lambda
Stars: ✭ 2,625 (+11313.04%)
Mutual labels:  lambda, serverless-plugin
Serverless Plugin Warmup
Keep your lambdas warm during winter. ♨
Stars: ✭ 814 (+3439.13%)
Mutual labels:  lambda, serverless-plugin
Serverless Appsync Plugin
serverless plugin for appsync
Stars: ✭ 804 (+3395.65%)
Mutual labels:  lambda, serverless-plugin
Serverless Layers
Serverless.js plugin that implements AWS Lambda Layers which reduces drastically lambda size, warm-up and deployment time.
Stars: ✭ 119 (+417.39%)
Mutual labels:  lambda, serverless-plugin
serverless-plugin-offline-kinesis-events
⚡ Serverless plugin that works with serverless-offline to allow offline testing of Serverless functions that are triggered by Kinesis events.
Stars: ✭ 15 (-34.78%)
Mutual labels:  serverless-plugin, serverless-offline
FancyDialog
Kotlin + DSL风格代替传统的Builder模式 诸多可配置项 高阶函数代替自定义回调接口 书写起来超级顺手
Stars: ✭ 24 (+4.35%)
Mutual labels:  lambda
jenkinsfile-runner-lambda
Run Jenkinsfiles in AWS Lambda
Stars: ✭ 52 (+126.09%)
Mutual labels:  lambda
spark-java8
Java 8 and Spark learning through examples
Stars: ✭ 40 (+73.91%)
Mutual labels:  lambda
lambda2js
Converts a C# expression tree (from Linq namespace) to a syntatically correct javascript code.
Stars: ✭ 51 (+121.74%)
Mutual labels:  lambda
roulier
API for package delivery
Stars: ✭ 18 (-21.74%)
Mutual labels:  parcel
serverless-typescript-starter
A Serverless starter that adds TypeScript, serverless-offline, linting, environment variables, and unit test support.
Stars: ✭ 75 (+226.09%)
Mutual labels:  serverless-offline
ebs-snapshot-lambda
AWS lambda function to snapshot EBS volumes and purge old snapshots.
Stars: ✭ 37 (+60.87%)
Mutual labels:  lambda
aws-node-custom-user-pool
Serverless AWS Cognito Custom User Pool Example
Stars: ✭ 15 (-34.78%)
Mutual labels:  lambda

serverless-plugin-parcel

serverless npm version

Serverless plugin for zero-config ES6/7 and Typescript support

This project is mostly a fork of serverless-plugin-typescript and was heavily inspired by that.

Features

  • Zero-config: Works out of the box without the need to install any other compiler or plugins
  • Supports sls package, sls deploy and sls deploy function
  • Supports sls invoke local
  • Integrates nicely with serverless-offline

Install

yarn add -D parcel-bundler serverless-plugin-parcel

or

npm install -D parcel-bundler serverless-plugin-parcel

Add the following plugin to your serverless.yml:

plugins:
    - serverless-plugin-parcel

Configure

By default, no configuration required, but you can change Parcel behavior by creating custom .babelrc file and in custom parcel section in serverless.yaml config:

custom:
    parcel:
        target: node
        cache: false

Check parceljs documentation for the full list of available options.

See example folder for a minimal example.

Automatic compilation

The normal Serverless deploy procedure will automatically compile with Parcel:

  • Create the Serverless project with serverless create -t aws-nodejs
  • Install Serverless Parcel Plugin as above
  • Deploy with serverless deploy

Usage with serverless-offline

The plugin integrates very well with serverless-offline to simulate AWS Lambda and AWS API Gateway locally.

Add the plugins to your serverless.yml file and make sure that serverless-plugin-parcel precedes serverless-offline as the order is important:

plugins: ...
    - serverless-plugin-parcel
    ...
    - serverless-offline
    ...

Run serverless offline or serverless offline start to start the Lambda/API simulation.

In comparison to serverless offline, the start command will fire an init and a end lifecycle hook which is needed for serverless-offline and e.g. serverless-dynamodb-local to switch off resources (see below)

serverless-dynamodb-local

Configure your service the same as mentioned above, but additionally add the serverless-dynamodb-local plugin as follows:

plugins:
    - serverless-plugin-parcel
    - serverless-dynamodb-local
    - serverless-offline

Run serverless offline start.

Run a function locally

To run your compiled functions locally you can:

$ serverless invoke local --function <function-name>

Options are:

  • --function or -f (required) is the name of the function to run
  • --path or -p (optional) path to JSON or YAML file holding input data
  • --data or -d (optional) input data

Enabling source-maps

You can easily enable support for source-maps (making stacktraces easier to read) by installing and using the following plugin:

yarn add -D source-map-support
// inside of your function
import 'source-map-support/register';

or using babel plugin:

yarn add source-map-support
yarn add -D babel-plugin-source-map-support

in .babelrc:

{
    "plugins": [
        "source-map-support"
    ]
    ...
}

Alternatives

serverless-parcel

Author

Pavel Vlasov

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