From 6d9dbe46d39cdd032d1d6ec630a85582188005fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Paulo?= Date: Thu, 17 Aug 2023 19:50:02 -0300 Subject: [PATCH] Add tip to wrap .js files in a NPM package to avoid needing externs --- docs/release.adoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/release.adoc b/docs/release.adoc index 856fa71..b52dd30 100644 --- a/docs/release.adoc +++ b/docs/release.adoc @@ -174,6 +174,8 @@ global:SomeGlobalVariable In this example the compiler will stop renaming `something.foo()`, `something.bar()`. +TIP: If you'd need to create a long `externs/.txt` (maybe a library is generating `.js` files), you have the option to wrap your `.js` files in an NPM package by placing them in `packages/`, running `npm init -y` and adding the build config `:js-options {:js-package-dirs ["node_modules" "packages"]}`. Doing so, your `.js` files will be treated like any other NPM package, so no externs required. + == Build Report [[build-report]] `shadow-cljs` can generate a detailed report for your `release` builds which includes a detailed breakdown of the included sources and how much they each contributed to the overall size.