Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nuxt.js hot-reload is slow

Tags:

nuxt.js

I want to know if it is normal that nuxt takes 2 or 3 seconds to make the hot reload changes? For example with Gatsby the Hot Reloads are instantaneous. I missed something?

Here is my nuxt build config:

build: {
    parallel: true,
    cache: true,
    extractCSS: process.env.NODE_ENV === 'production',
    optimizeCSS: process.env.NODE_ENV === 'production',
    transpile: ['vue-intersect'],
},

like image 429
jbty Avatar asked Aug 04 '20 12:08

jbty


1 Answers

I think your problem is because you have a property components setted as true.

  • Nuxt.js 2.13+ can scan and auto import your components. But by default this option in setted with false. You don't need set it to true.

When set to true or using an object, it will include the nuxt/components dependencies and auto import your components (defined in ~/components) when you use them in your templates.

...
// change to false, or remove this config.
components: true
...

Only set to true if you know why you need this property as true. So you can find more about this, in the Nuxt Docs https://nuxtjs.org/api/configuration-components and in the Github docs https://github.com/nuxt/components.

like image 160
Henrique Van Klaveren Avatar answered Nov 02 '22 19:11

Henrique Van Klaveren