1

When I change ssr property to false in nuxt.config.js, intending to get client-side rendering application, and insert a build command, Nuxt generates a bunch of static pages.
I do have target: server (default).
Why does it happen and how to prevent it?

kissu
  • 40,416
  • 14
  • 65
  • 133
Max S
  • 109
  • 1
  • 4

1 Answers1

0

So, you mean static pages into dist directory right? What is the issue with this?

This is essentially for lazy loading depending on the routes afterwards. And that way, you can also inspect what is happening there more easily. If you do disable JS in your browser, you'll see that your client app will be empty.

kissu
  • 40,416
  • 14
  • 65
  • 133
  • Yes, it is empty on JS off, but when it is on -- a lot of .js are loaded and the pages' js are among them. And my goal is to reduce a number of js loaded during first load. – Max S Jul 08 '21 at 09:56
  • 1
    Nuxt does route-splitting, Vuex and a lot of things for you out of the box. You should not worry to much about having several files if they are optimized and small. Loading a bigger single one, is far more annoying tbh. If you want to go into optimization, you can check this blogpost, it will be a good starting point if you're into optimization: https://www.dawntraoz.com/blog/my-web-performance-journey-with-nuxt-storyblok-netlify It's like this post: https://stackoverflow.com/a/67526276/8816585 It's not an approach that I'd recommend anytime soon. – kissu Jul 08 '21 at 15:44