question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Asset compression support with `nuxi generate`

See original GitHub issue

Nitro 0.5.x added new option to enable assets pre-compression (https://github.com/unjs/nitro/pull/449) and can be enabled using this:

import { defineNuxtConfig } from 'nuxt'

export default defineNuxtConfig({
  nitro: {
    compressPublicAssets: true,
  },
})

Currently, it only works with nuxi build that runs the public assets plugin but nuxi generate seems not working (thanks @fedeweb for pointing it out!)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
xajacommented, Sep 30, 2022

yes, it works for static files, but not applied for html. why? google insights says “turn on gzip” for one source — the page itself

2022-09-30_235530

1reaction
RezaErfani67commented, Oct 26, 2022

@pi0 can you please help me?

Read more comments on GitHub >

github_iconTop Results From Across the Web

NuxtJS Static Assets Compression with nuxt-compress
Run your build script (e.g. npm run generate ) and your files will be automatically compressed. Check your built .js files (mine is...
Read more >
The build Property - Nuxt
Nuxt lets you customize the webpack configuration for building your web application as you want.
Read more >
averjs/nuxt-compression - npm
This is an unofficial compression module for Nuxt 3. Currently it only works with vite . It uses vite-plugin-compression to generate the ...
Read more >
how to make a compressed js files with all pages in nuxt js
Well, code splitting the pages should make your page faster. Because each route loads ... You should check if your hoster supports HTTP2....
Read more >
Vue and Nuxt Performance Optimization Checklist
Using your image CDN service or the compression of your image should be ... In Nuxt we have --modern with some options in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found