bridge icon indicating copy to clipboard operation
bridge copied to clipboard

Nitro server build takes a long time

Open warflash opened this issue 1 year ago • 4 comments

Environment


  • Operating System: Windows_NT
  • Node Version: v16.13.2
  • Nuxt Version: 2.16.0-27616340.013f051b
  • Package Manager: [email protected]
  • Builder: webpack
  • User Config: buildModules, serverHandlers, devServerHandlers, bridge
  • Runtime Modules: -
  • Build Modules: (), @nuxtjs/[email protected], @nuxt/[email protected]

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: https://github.com/nuxt/bridge/discussions/394; https://github.com/nuxt/bridge/discussions/379 Discord: https://discord.com/channels/473401852243869706/992155295927251074/997164491689181275

Additional context

No response

Logs

No response

warflash avatar Jul 18 '22 12:07 warflash

Would you try setting nitro.autoImport.exclude? https://github.com/nuxt/framework/pull/5981

danielroe avatar Jul 19 '22 14:07 danielroe

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?

dargmuesli avatar Jul 19 '22 15:07 dargmuesli

Try this?

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

cinob avatar Jul 19 '22 15:07 cinob

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

dargmuesli avatar Jul 19 '22 15:07 dargmuesli

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

warflash avatar May 02 '23 00:05 warflash