Package Exports
- esbuild-cf-functions-plugin
Readme
esbuild-cf-functions-plugin
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.
Check out the example!
Usage
Installation
npm i -D esbuild-cf-functions-pluginpnpm i -D esbuild-cf-functions-pluginyarn 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()],
})The plugin overrides the format and target options, unless I did something wrong.