one of our third party libraries requires us to preserve specific function names. in webpack we did that with terser.keep_fnames
. esbuild has https://esbuild.github.io/api/#keep-names so we'd like to use that but we cannot find how to enable this option for a vite production build.
according to the docs esbuild is used for minification. how do we enable this flag (or a comparable option)? note that we'd like to not use terser, as its much slower than esbuild.
there is an undocumented config.esbuild
prop. that seems to be used in the current master code:
https://github.com/vitejs/vite/blob/f72fdc7c995db502ca89f0057cfc1fcd6660212f/packages/vite/src/node/plugins/esbuild.ts#L352
but when i tried adding config.esbuild.keepNames
to the config object (as object fields of course) it didnt do anything.