basics / nuxt-booster

nuxt-booster will help you to improve the lighthouse performance score (100/100) of your website. πŸš€
https://basics.github.io/nuxt-booster/
MIT License
599 stars 30 forks source link

Nuxt booster breaks if Nuxt autoimport feature is disabled #1019

Closed vhovorun closed 1 month ago

vhovorun commented 1 month ago

Describe the bug Nuxt booster breaks if Nuxt autoimport feature is disabled

To Reproduce Steps to reproduce the behavior:

  1. Add this to the nuxt.config.ts file
imports: {
  autoImport: false,
}
  1. Try to run the project in dev mode
  2. See error image

Expected behavior Should be usable with disabled nuxt autoimports feature

Additional context Nuxt version - 3.11.2 Nuxt booster verstion - ^3.0.15

ThornWalli commented 1 month ago

Hello @vhovorun,

you can try this version nuxt-booster@3.0.16-next.1.

vhovorun commented 1 month ago

@ThornWalli Thanks, one more question I've noticed that nuxt-booster takes all css (excluding current page) from pages and components and loads it in one file, because of that pagespeed insight shows the next warning (see the image attached below), I've checked if I disable nuxt-booster css from pages and components only loads when I navigate to them. Is there some way how to fix this behaviour? image

ThornWalli commented 1 month ago

@vhovorun I activate the Vite cssCodeSplit again.

Now the CSS should be loaded again via component when active.

However, every link[rel=β€œstyle”] in the SSR HTML is still embedded directly in the markup and removed.

You can test it πŸ™‚

nuxt-booster@3.0.16-next.2

vhovorun commented 1 month ago

@ThornWalli Now works correctly, thanks a lot for a quick replay!

vhovorun commented 1 month ago

@ThornWalli One more question though, I've noticed that on the mobile TBT (Total Blocking Time) is 0ms, but on desktop version it's 200-300ms. Is configurable to reduce the TBT to 0 on desktop version too? Or I should use some other library like nuxt-lazy-hydrate for that? image image

ThornWalli commented 1 month ago

@vhovorun Integrating the module is the first step πŸ™ƒ

  1. when it comes to lazy-hydrate is already integrated πŸ™‚ https://basics.github.io/nuxt-booster/guide/usage.html#import-components
  2. offer a font integration per directive, does not have to load everything.
  3. and also picture or image components, these are based on the @nuxt/image API. Here the focus is on ssr and preloads.

Take a look at the example πŸ˜‰, especially because of correct composable use etc. https://github.com/basics/nuxt-booster/tree/main/playground

Hope this helps πŸ™‚