Skip to content

Commit 98f4bde

Browse files
committed
output esm
1 parent eca8f12 commit 98f4bde

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.changeset/fuzzy-donuts-double.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"esbuild-cf-functions-plugin": patch
3+
---
4+
5+
Changed the output format to ES modules.
6+
7+
This should always result in smaller output file sizes!
8+
9+
For example, the example function went from `1.3kb` to `0.45kb`!

src/plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const CloudFrontFunctionsPlugin = (): Plugin => ({
2020

2121
setup: (build) => {
2222
build.initialOptions.target = "es5"
23-
build.initialOptions.format = "cjs"
23+
build.initialOptions.format = "esm"
2424

2525
if (build.initialOptions.minify) {
2626
build.initialOptions.minify = false

0 commit comments

Comments
 (0)