Builds a Vite configuration for a library, with overridable output formats
and entry.
This is the factory behind DEFAULT_VITE_LIB_CONFIG; calling it with no
arguments produces the same configuration. Prefer it over merging on top of
DEFAULT_VITE_LIB_CONFIG when you need to change formats, because Vite's
mergeConfig concatenates arrays and therefore cannot shrink ['es', 'cjs']
back down to ['es'].
esbuild does not need to be disabled here to preserve comments as it's
expected to generate d.ts files from the ts files when publishing and
those will preserve the comments in the d.ts files.
Builds a Vite configuration for a library, with overridable output
formatsandentry.This is the factory behind DEFAULT_VITE_LIB_CONFIG; calling it with no arguments produces the same configuration. Prefer it over merging on top of
DEFAULT_VITE_LIB_CONFIGwhen you need to changeformats, because Vite'smergeConfigconcatenates arrays and therefore cannot shrink['es', 'cjs']back down to['es'].esbuild does not need to be disabled here to preserve comments as it's expected to generate d.ts files from the ts files when publishing and those will preserve the comments in the d.ts files.