Disable Prefetch/Preload in dev mode on Nuxt Bridge
Hi there, does anyone know of a way to disable the prefetch/preload behavior during development while being on nuxt-bridge?
I managed to disable it in production in the final build by adding a module with the following code:
But like I said this does not work when running
yarn dev
for example. I would really appreciate any help on this. Thanks.
Oh, yet I am still using webpack unfortunately, not on vite but working on it.2 Replies
Hi @davidk. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the information provided in the knowledge sources, I can offer some insights on disabling prefetch/preload behavior in Nuxt, but there are some limitations regarding your specific scenario with Nuxt Bridge and webpack in development mode.
For Nuxt 3, there is a way to disable prefetching globally, which is described in the Nuxt documentation. However, this configuration is for Nuxt 3 and may not be directly applicable to Nuxt Bridge.
Unfortunately, the knowledge sources don't provide specific information about disabling prefetch/preload in development mode for Nuxt Bridge using webpack. The module you've created seems to target the build process, which explains why it works in production but not in development.
For development mode, Nuxt typically uses different mechanisms for serving content, and the build:manifest hook you're using might not be triggered or might behave differently.
Given that you're using Nuxt Bridge and webpack, and considering the lack of specific information in the provided knowledge sources about this particular setup, I cannot provide a definitive solution to disable prefetch/preload in development mode.
However, here are a few suggestions that might help you investigate further:
1. Check if there are any Nuxt Bridge specific configurations that allow controlling prefetch/preload behavior.
2. Look into webpack-specific configurations within your Nuxt Bridge setup that might allow you to modify how resources are loaded during development.
3. Consider reaching out to the Nuxt community or creating an issue on the Nuxt Bridge repository to get more specific guidance for your use case.
I apologize that I couldn't provide a more concrete solution based on the available information. The transition from Nuxt 2 to Nuxt 3 using Nuxt Bridge, especially when still using webpack, introduces complexities that are not fully covered in the provided knowledge sources.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
<@897976669636296734> Kapa.ai is still learning and improving, please let me know how I did by reacting below.