I haven't used Astro before, but does this help?
How to minify automatically JavaScript and CSS in Astro (vs-code)
It looks like Astro builds on top of Vite, so adding
vite: {
build: {
minify: true,
cssMinify: true,
}
}
to your defineConfig in astro.config should minify all files on build.
And I think bundling can be taken care of by adding in config vals to rollupOptions in the build property
Something like
vite: {
build: {
minify: true,
cssMinify: true,
rollupOptions: {
output: {
....//
}
}
}
}
It should support all the options here Rollup Configuration options allowing you to customize your build as you like.
Again, I haven't used Astro in particular before, just spitballing what might work.