79364740

Date: 2025-01-17 12:27:02
Score: 0.5
Natty:
Report link

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.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: LoopsMcBeetle