title: How do I make my Nuxt app (v3) serve .mjs.br (brotli) files instead of the regular .mjs files? (Text compression)
body: <p>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).</p>
  <p>I was able to make the server output <code>.mjs.br</code> files implementing <code>vite-plugin-compression</code> in the nuxt config:</p>
  <pre><code>import viteCompression from &quot;vite-plugin-compression&quot;;
  
  export default defineNuxtConfig({
    vite: {
      plugins: [viteCompression({ algorithm: &quot;brotliCompress&quot; })],
    },
  ...
  </code></pre>
  <p>Despite <code>.mjs.br</code> files being generated, <code>.mjs</code> files were still being served by default.</p>
  <p>How can I make Nuxt serve the brotli-compressed files instead? Or is this not possible yet?</p>