From 9f06a3b9cb4618a4efc0058bccf0fd56ca6ce796 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 13 Feb 2025 10:44:44 +0100 Subject: [PATCH] js/esbuild: Add drop option Fixes #13362 --- content/en/functions/js/_common/options.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/content/en/functions/js/_common/options.md b/content/en/functions/js/_common/options.md index e2b6566ad..0d6138a7b 100644 --- a/content/en/functions/js/_common/options.md +++ b/content/en/functions/js/_common/options.md @@ -81,6 +81,14 @@ import * as ReactDOM from 'react-dom/client'; {{ $defines := dict "process.env.NODE_ENV" `"development"` }} ``` +##### drop + +Edit your source code before building to drop certain constructs: One of `debugger` or `console`. + +{{< new-in 0.144.0 />}} + +See https://esbuild.github.io/api/#drop + ###### sourceMap (`string`) Whether to generate `inline`, `linked` or `external` source maps from esbuild. Linked and external source maps will be written to the target with the output file name + ".map". When `linked` a `sourceMappingURL` will also be written to the output file. By default, source maps are not created. Note that the `linked` option was added in Hugo 0.140.0.