#Minify js code with backtick when using esbuild?

1 messages · Page 1 of 1 (latest)

safe crystal
#

Hi,
I have a react app with vite and we use esbuild to minify JS. I noticed that CSS code in backtick is not minified. Is there an option in ESBuild or Vite to turn it on? I think removing whitespaces from that part should be an easy task for minifier.

export default defineConfig({
plugins: [react(),
esbuild: {
drop: ['console', 'debugger'],
// anything I can set here?
}]
});

safe crystal
#

Actually this might not be easy. It's a string value set in js so minifier doesn't know if it's a title of the page or CSS. Those css blocks are coming with npm packages.