From a1377d3cf94cf2b54f4239c56a8cf8d4119c8a44 Mon Sep 17 00:00:00 2001 From: Evan Wallace Date: Sun, 15 Nov 2020 16:21:15 -0800 Subject: [PATCH] cleanup after landing #531 --- CHANGELOG.md | 4 ++++ cmd/esbuild/main.go | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d42c6b36661..1d394c96135 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +* Add the `--banner` and `--footer` options ([#482](https://github.com/evanw/esbuild/issues/482)) + + You can now use the `--banner` and `--footer` options to insert code before and/or after the code that esbuild generates. This is usually used to insert a banner comment at the top of your bundle. However, you can also use this for other purposes such as wrapping your whole bundle in `--banner='try {'` and `--footer='} catch (e) { reportError(e) }'`. Note that since these strings can contain partial JavaScript syntax, esbuild will not do anything to ensure the result is valid JavaScript syntax. This feature was contributed by [@Gelio](https://github.com/Gelio). + * Be more permissive inside TypeScript `declare` contexts These cases are now allowed by esbuild: diff --git a/cmd/esbuild/main.go b/cmd/esbuild/main.go index 8cdc6928095..105c92e374d 100644 --- a/cmd/esbuild/main.go +++ b/cmd/esbuild/main.go @@ -31,8 +31,6 @@ Options: is browser and cjs when platform is node) --splitting Enable code splitting (currently only for esm) --global-name=... The name of the global for the IIFE format - --banner=... Text to be prepended to each output file - --footer=... Text to be appended to each output file --minify Sets all --minify-* flags --minify-whitespace Remove whitespace @@ -48,6 +46,8 @@ Options: Advanced options: --version Print the current version and exit (` + esbuildVersion + `) + --banner=... Text to be prepended to each output file + --footer=... Text to be appended to each output file --outbase=... The base path used to determine entry point output paths (for multiple entry points) --sourcemap=inline Emit the source map with an inline data URL