Skip to content

Commit

Permalink
output esm
Browse files Browse the repository at this point in the history
  • Loading branch information
beeequeue committed Jun 19, 2022
1 parent eca8f12 commit 98f4bde
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .changeset/fuzzy-donuts-double.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"esbuild-cf-functions-plugin": patch
---

Changed the output format to ES modules.

This should always result in smaller output file sizes!

For example, the example function went from `1.3kb` to `0.45kb`!
2 changes: 1 addition & 1 deletion src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const CloudFrontFunctionsPlugin = (): Plugin => ({

setup: (build) => {
build.initialOptions.target = "es5"
build.initialOptions.format = "cjs"
build.initialOptions.format = "esm"

if (build.initialOptions.minify) {
build.initialOptions.minify = false
Expand Down

0 comments on commit 98f4bde

Please sign in to comment.