Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nitro server build takes a long time #421

Closed
warflash opened this issue Jul 18, 2022 · 5 comments
Closed

Nitro server build takes a long time #421

warflash opened this issue Jul 18, 2022 · 5 comments

Comments

@warflash
Copy link
Member

Environment


  • Operating System: Windows_NT
  • Node Version: v16.13.2
  • Nuxt Version: 2.16.0-27616340.013f051b
  • Package Manager: npm@8.13.2
  • Builder: webpack
  • User Config: buildModules, serverHandlers, devServerHandlers, bridge
  • Runtime Modules: -
  • Build Modules: (), @nuxtjs/vuetify@1.12.3, @nuxt/bridge@0.10.1

Reproduction

https://github.com/warflash/nuxt-bridge-server-build

Describe the bug

In my case adding vuetify makes the build time using nuxi build go from a few seconds to ~10 minutes.
Setting bridge.nitro: false makes the build go through as fast as one would expect.
Possibly related discussions: #394; #379
Discord: https://discord.com/channels/473401852243869706/992155295927251074/997164491689181275

Additional context

No response

Logs

No response

@danielroe
Copy link
Member

danielroe commented Jul 19, 2022

Would you try setting nitro.autoImport.exclude? nuxt/framework#5981

@dargmuesli
Copy link
Member

I experience the same issue and have added

  nitro: {
    autoImport: {
      exclude:
        '[/[\\/]node_modules[\\/]/, /[\\/].git[\\/]/, /[\\/].nuxt[\\/]/]',
    },
  },

to nuxt.config.ts.
That did not solve the issue for me. Maybe I did something wrong?

@cinob
Copy link

cinob commented Jul 19, 2022

Try this?

nitro: {
  autoImport: {
    exclude: [/[\\/]node_modules[\\/]/, /[\\/]\.git[\\/]/, /[\\/]\.nuxt[\\/]/],
  },
},

@dargmuesli
Copy link
Member

Indeed! Added quotes by mistake. Now the build time for my project is reduced from 9 minutes back to 2.5 minutes 🎉

@warflash
Copy link
Member Author

warflash commented May 2, 2023

Closing as this has been fixed upstream in nitro💚(kinda forgot about it)

@warflash warflash closed this as completed May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants