minifyastrojs

How to minify automatically JavaScript and CSS in Astro (vs-code)


I am using Astro on VS-code and would like to find a way to automatically minify JavaScript and CSS files

I would like to minify the files in production when the build is launched


Solution

  • Astro already bundles and minifies a lot of the code but you can also use the astro-compress integration to compress/minify your build further

    You can also use post build processing tools for compression like: