You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

esbuild-cf-functions-plugin

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

esbuild-cf-functions-plugin

A plugin to configure ESBuild for building code compatible with CloudFront Functions


Version published
Weekly downloads
522
increased by5.03%
Maintainers
1
Created
Weekly downloads
 

Changelog

Source

1.1.0

Minor Changes

Readme

Source

esbuild-cf-functions-plugin

npm node-current esbuild-current Codecov

This plugin configures ESBuild for building code compatible with CloudFront Functions.

As can be seen in the documentation, CloudFront Functions do not run on Node, but on AWS's custom JS runtime.

According to them, it

... is compliant with ECMAScript (ES) version 5.1 and also supports some features of ES versions 6 through 9.

This plugin does its best to enable and disable transpiling features as the documentation says is available for the v1 runtime and v2 runtime. By default the v1 runtime is assumed.

Check out the example!

Usage

Installation
npm i -D esbuild-cf-functions-plugin
pnpm i -D esbuild-cf-functions-plugin
yarn add -D esbuild-cf-functions-plugin
// build.mjs
import { build } from "esbuild"
import { CloudFrontFunctionsPlugin } from "esbuild-cf-functions-plugin"

void build({
  entryPoints: ["src/index.ts"],
  outdir: "dist",

  minify: true,
  logLevel: "info",

  plugins: [CloudFrontFunctionsPlugin()],
})

To enable v2 runtime features:

  plugins: [CloudFrontFunctionsPlugin({ runtimeVersion: 2 })],

The plugin overrides the format and target options, unless I did something wrong.

Keywords

FAQs

Package last updated on 22 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc