I deployed a simple Nuxt (version 3) app over Google Cloud Run and tested the performance using Lighthouse. The score was pretty horrible but one of the most impactful improvements it offered was to enable text compression (gzip or brotli).
I was able to make the server output .mjs.br
files implementing vite-plugin-compression
in the nuxt config:
import viteCompression from "vite-plugin-compression";
export default defineNuxtConfig({
vite: {
plugins: [viteCompression({ algorithm: "brotliCompress" })],
},
...
Despite .mjs.br
files being generated, .mjs
files were still being served by default.
How can I make Nuxt serve the brotli-compressed files instead? Or is this not possible yet?